SlideShare a Scribd company logo
1 of 39
Download to read offline
foto: Anders Sandberg
Wednesday 6 November 13
Full text search met
elasticsearch in de praktijk
Jeroen van Wilgenburg, JPoint
@jvwilge
vanwilgenburg.wordpress.com

Wednesday 6 November 13
Vragen voor jullie

Wednesday 6 November 13
Vragen voor jullie
• Wie heeft Lucene wel eens gebruikt?

Wednesday 6 November 13
Vragen voor jullie
• Wie heeft Lucene wel eens gebruikt?
• SOLR?

Wednesday 6 November 13
Vragen voor jullie
• Wie heeft Lucene wel eens gebruikt?
• SOLR?
• Compass?

Wednesday 6 November 13
Vragen voor jullie
• Wie heeft Lucene wel eens gebruikt?
• SOLR?
• Compass?
• elasticsearch?

Wednesday 6 November 13
Vragen voor jullie
• Wie heeft Lucene wel eens gebruikt?
• SOLR?
• Compass?
• elasticsearch?
• waar komen de servernamen vandaan?
Wednesday 6 November 13
Wat is elasticsearch?
• full text search engine obv Lucene
• REST-api
• Distributed / High availability
• Document oriënted (nested maps)
Wednesday 6 November 13
Wie gebruiken es?

Wednesday 6 November 13
Ook elastic
• elastic compute cloud (EC2)
• elastic beanstalk
• elastic load balancer
• elastic map reduce
• elastic transcoder
• Elasticache
foto: Nick Richards
Wednesday 6 November 13
BPO-register
• vinden van koopvaardijschepen met historie
• Hibernate Envers, Spring en Twitter
Bootstrap

• begonnen met Hibernate Search, vervangen
door elasticsearch

• géén clustering gebruikt
Wednesday 6 November 13
Hibernate Search

foto: Flickr - DVIDSHUB
Wednesday 6 November 13
elasticsearch

foto: Flickr - quinn anya
Wednesday 6 November 13
Clusternaam

Wednesday 6 November 13
Pas op met defaults!
• Gericht op ec2
• Goed om elasticsearch te leren
• 10 hits bij zoekresultaten
• voorbeeld (filmpje)
Wednesday 6 November 13
Insecure by design
• zorg dat elasticsearch in gesloten netwerk
draait

• wat er niet is kan ook niet stuk

Wednesday 6 November 13
Documentatie
• elasticsearch.org
• docs, blogs, video’s (es + youtube)
• google & stackoverflow
• boek van O’reilly in ontwikkeling
Wednesday 6 November 13
Community/support
• binnen dag reactie op artikel
• www.meetup.com/ElasticSearch-NL
• Gevestigd in Amsterdam

Wednesday 6 November 13
Tools
• command line curl +

chrome web inspector

• plugins
• elasticsearch head
• Inquisitor
• Elastic HQ
Wednesday 6 November 13
Query basics
• rotterdam
• name:rotterdam
• name:rotterdam +homeport:amsterdam
• +name:rotterdam +homeport:amsterdam
• *gracht
• happy abis dover
• happy abis^2 dover
Wednesday 6 November 13
Mappings
• default: dynamic mapping (schemaless)
• include_in_all

Wednesday 6 November 13
Analyzers
• index analyzer
• search analyzer
• _all is aparte analyzer (ipv per key)
• Inquisitor-plugin (demo)
Wednesday 6 November 13
Diakrieten
• instellen bij beide analyzers
• encoding van Spring
• encoding van EC2
• stackoverflow.com/questions/12016318/
Wednesday 6 November 13
Wildcard
• apart opgeven in query
• suffix-wildcard is ok
• prefix is traaaaag
• boosting werkt niet meer (in onderzoek)
• “rewrite” : “scoring_boolean”
Wednesday 6 November 13
NL

AG

UK

NO

CY

LR

IT

BS

PA

BE

MT

GI

©2013 The World Flag Database & Graham Bartram

Wednesday 6 November 13
NL

AG

UK

NO

CY

LR

IT

BS

PA

BE

MT

GI

©2013 The World Flag Database & Graham Bartram

Wednesday 6 November 13
NO

IT

BE
©2013 The World Flag Database & Graham Bartram

Wednesday 6 November 13
Stop words
• a, an, and, are, as, at, be, but, by, for, if, in,

into, is, it, no, not, of, on, or, such, that, the,
their, then, there, these,they, this, to, was,
will, with

Wednesday 6 November 13
Scoring
• ‘magic’ formula
• oa. aantal voorkomens van term in hele set

Wednesday 6 November 13
Sorteren
• “Can’t sort on string types with more than

one value per doc, or more than one token
per field”

• Voeg veld <veldnaam>.untouched toe
• http://bit.ly/wFd8CZ
Wednesday 6 November 13
Sorteren
• Lastig uitleggen aan eindgebruikers
• Gebruik een balkje met rang

Wednesday 6 November 13
Spring
• github.com/dadoonet
• Tweet David Pilato dat je het gebruikt
• Maak voldoende testqueries
• codevoorbeeld
Wednesday 6 November 13
Unit-test
• refresh na een update
• draai unit-test op andere poort/clusternaam
• codevoorbeeld

Wednesday 6 November 13
Sharding en scoring
• Default is score per shard bereken
• Cluster scores die dicht bij elkaar liggen en
ga dan sorteren

• dfs query then fetch (http://bit.ly/1cBRxMv)

Wednesday 6 November 13
Conclusie
• Snel aan de slag
• Even zoeken naar de goede documentatie
• Scoring snappen snel waardevol

Wednesday 6 November 13
Vragen?

Wednesday 6 November 13
Logstash + Kibana

Wednesday 6 November 13
elasticsearch in
de praktijk
Jeroen van Wilgenburg
www.jpoint.nl
@jvwilge

vanwilgenburg.wordpress.com
photo by ny156uk on Flickr

Wednesday 6 November 13

More Related Content

More from NLJUG

The future of Web-Scale - Johan Tillema, Rene Boere & Chris Quach
The future of Web-Scale - Johan Tillema, Rene Boere & Chris QuachThe future of Web-Scale - Johan Tillema, Rene Boere & Chris Quach
The future of Web-Scale - Johan Tillema, Rene Boere & Chris QuachNLJUG
 
Speedy perception trumps speedy reception–smart asynchronous interactions - L...
Speedy perception trumps speedy reception–smart asynchronous interactions - L...Speedy perception trumps speedy reception–smart asynchronous interactions - L...
Speedy perception trumps speedy reception–smart asynchronous interactions - L...NLJUG
 
Decoding the airspace above you with Java and $7 hardware - Bert Jan Schrijver
Decoding the airspace above you with Java and $7 hardware - Bert Jan SchrijverDecoding the airspace above you with Java and $7 hardware - Bert Jan Schrijver
Decoding the airspace above you with Java and $7 hardware - Bert Jan SchrijverNLJUG
 
Using Docker to Develop, Test and Run Maven Projects - Wouter Danes
Using Docker to Develop, Test and Run Maven Projects - Wouter DanesUsing Docker to Develop, Test and Run Maven Projects - Wouter Danes
Using Docker to Develop, Test and Run Maven Projects - Wouter DanesNLJUG
 
Kill the mutants and test your tests - Roy van Rijn
Kill the mutants and test your tests - Roy van RijnKill the mutants and test your tests - Roy van Rijn
Kill the mutants and test your tests - Roy van RijnNLJUG
 
Real-time user interfaces - sosm gewoon makkelijker - Allard Buijze
Real-time user interfaces - sosm gewoon makkelijker - Allard BuijzeReal-time user interfaces - sosm gewoon makkelijker - Allard Buijze
Real-time user interfaces - sosm gewoon makkelijker - Allard BuijzeNLJUG
 
The end of traditional enterprise IT - ING's journey to the next generation I...
The end of traditional enterprise IT - ING's journey to the next generation I...The end of traditional enterprise IT - ING's journey to the next generation I...
The end of traditional enterprise IT - ING's journey to the next generation I...NLJUG
 
Performance van Java 8 en verder - Jeroen Borgers
Performance van Java 8 en verder - Jeroen BorgersPerformance van Java 8 en verder - Jeroen Borgers
Performance van Java 8 en verder - Jeroen BorgersNLJUG
 
Introduction to Reactive with Play and Akka - Markus Jura
Introduction to Reactive with Play and Akka - Markus JuraIntroduction to Reactive with Play and Akka - Markus Jura
Introduction to Reactive with Play and Akka - Markus JuraNLJUG
 
Web-scale op basis van Hadoop en Akka Reactive Streams - Johan Tillema, Rene ...
Web-scale op basis van Hadoop en Akka Reactive Streams - Johan Tillema, Rene ...Web-scale op basis van Hadoop en Akka Reactive Streams - Johan Tillema, Rene ...
Web-scale op basis van Hadoop en Akka Reactive Streams - Johan Tillema, Rene ...NLJUG
 
Workshop angular dart presentatie - Atos
Workshop angular dart presentatie - AtosWorkshop angular dart presentatie - Atos
Workshop angular dart presentatie - AtosNLJUG
 
Workshop spring boot presentatie - Atos
Workshop spring boot presentatie - AtosWorkshop spring boot presentatie - Atos
Workshop spring boot presentatie - AtosNLJUG
 
Cultivating the jenkins job jungle with groovy - Patrick van Dissel
Cultivating the jenkins job jungle with groovy - Patrick van DisselCultivating the jenkins job jungle with groovy - Patrick van Dissel
Cultivating the jenkins job jungle with groovy - Patrick van DisselNLJUG
 
Rethink your architecture - Marten Deinum
Rethink your architecture - Marten DeinumRethink your architecture - Marten Deinum
Rethink your architecture - Marten DeinumNLJUG
 
Evolutionary Algorithms: the key to solving complex Java puzzles! - Bas knopper
Evolutionary Algorithms: the key to solving complex Java puzzles! - Bas knopperEvolutionary Algorithms: the key to solving complex Java puzzles! - Bas knopper
Evolutionary Algorithms: the key to solving complex Java puzzles! - Bas knopperNLJUG
 
Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...
Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...
Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...NLJUG
 
Apache Wicket: 10 jaar en verder - Martijn Dashorst
Apache Wicket: 10 jaar en verder - Martijn DashorstApache Wicket: 10 jaar en verder - Martijn Dashorst
Apache Wicket: 10 jaar en verder - Martijn DashorstNLJUG
 
Opening - Bert Ertman
Opening - Bert ErtmanOpening - Bert Ertman
Opening - Bert ErtmanNLJUG
 
Returning the right results - Jettro Coenradie
Returning the right results - Jettro CoenradieReturning the right results - Jettro Coenradie
Returning the right results - Jettro CoenradieNLJUG
 
Reactive programming met Java 8 en Java EE 7 - Martijn Blankestijn
Reactive programming met Java 8 en Java EE 7 - Martijn BlankestijnReactive programming met Java 8 en Java EE 7 - Martijn Blankestijn
Reactive programming met Java 8 en Java EE 7 - Martijn BlankestijnNLJUG
 

More from NLJUG (20)

The future of Web-Scale - Johan Tillema, Rene Boere & Chris Quach
The future of Web-Scale - Johan Tillema, Rene Boere & Chris QuachThe future of Web-Scale - Johan Tillema, Rene Boere & Chris Quach
The future of Web-Scale - Johan Tillema, Rene Boere & Chris Quach
 
Speedy perception trumps speedy reception–smart asynchronous interactions - L...
Speedy perception trumps speedy reception–smart asynchronous interactions - L...Speedy perception trumps speedy reception–smart asynchronous interactions - L...
Speedy perception trumps speedy reception–smart asynchronous interactions - L...
 
Decoding the airspace above you with Java and $7 hardware - Bert Jan Schrijver
Decoding the airspace above you with Java and $7 hardware - Bert Jan SchrijverDecoding the airspace above you with Java and $7 hardware - Bert Jan Schrijver
Decoding the airspace above you with Java and $7 hardware - Bert Jan Schrijver
 
Using Docker to Develop, Test and Run Maven Projects - Wouter Danes
Using Docker to Develop, Test and Run Maven Projects - Wouter DanesUsing Docker to Develop, Test and Run Maven Projects - Wouter Danes
Using Docker to Develop, Test and Run Maven Projects - Wouter Danes
 
Kill the mutants and test your tests - Roy van Rijn
Kill the mutants and test your tests - Roy van RijnKill the mutants and test your tests - Roy van Rijn
Kill the mutants and test your tests - Roy van Rijn
 
Real-time user interfaces - sosm gewoon makkelijker - Allard Buijze
Real-time user interfaces - sosm gewoon makkelijker - Allard BuijzeReal-time user interfaces - sosm gewoon makkelijker - Allard Buijze
Real-time user interfaces - sosm gewoon makkelijker - Allard Buijze
 
The end of traditional enterprise IT - ING's journey to the next generation I...
The end of traditional enterprise IT - ING's journey to the next generation I...The end of traditional enterprise IT - ING's journey to the next generation I...
The end of traditional enterprise IT - ING's journey to the next generation I...
 
Performance van Java 8 en verder - Jeroen Borgers
Performance van Java 8 en verder - Jeroen BorgersPerformance van Java 8 en verder - Jeroen Borgers
Performance van Java 8 en verder - Jeroen Borgers
 
Introduction to Reactive with Play and Akka - Markus Jura
Introduction to Reactive with Play and Akka - Markus JuraIntroduction to Reactive with Play and Akka - Markus Jura
Introduction to Reactive with Play and Akka - Markus Jura
 
Web-scale op basis van Hadoop en Akka Reactive Streams - Johan Tillema, Rene ...
Web-scale op basis van Hadoop en Akka Reactive Streams - Johan Tillema, Rene ...Web-scale op basis van Hadoop en Akka Reactive Streams - Johan Tillema, Rene ...
Web-scale op basis van Hadoop en Akka Reactive Streams - Johan Tillema, Rene ...
 
Workshop angular dart presentatie - Atos
Workshop angular dart presentatie - AtosWorkshop angular dart presentatie - Atos
Workshop angular dart presentatie - Atos
 
Workshop spring boot presentatie - Atos
Workshop spring boot presentatie - AtosWorkshop spring boot presentatie - Atos
Workshop spring boot presentatie - Atos
 
Cultivating the jenkins job jungle with groovy - Patrick van Dissel
Cultivating the jenkins job jungle with groovy - Patrick van DisselCultivating the jenkins job jungle with groovy - Patrick van Dissel
Cultivating the jenkins job jungle with groovy - Patrick van Dissel
 
Rethink your architecture - Marten Deinum
Rethink your architecture - Marten DeinumRethink your architecture - Marten Deinum
Rethink your architecture - Marten Deinum
 
Evolutionary Algorithms: the key to solving complex Java puzzles! - Bas knopper
Evolutionary Algorithms: the key to solving complex Java puzzles! - Bas knopperEvolutionary Algorithms: the key to solving complex Java puzzles! - Bas knopper
Evolutionary Algorithms: the key to solving complex Java puzzles! - Bas knopper
 
Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...
Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...
Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...
 
Apache Wicket: 10 jaar en verder - Martijn Dashorst
Apache Wicket: 10 jaar en verder - Martijn DashorstApache Wicket: 10 jaar en verder - Martijn Dashorst
Apache Wicket: 10 jaar en verder - Martijn Dashorst
 
Opening - Bert Ertman
Opening - Bert ErtmanOpening - Bert Ertman
Opening - Bert Ertman
 
Returning the right results - Jettro Coenradie
Returning the right results - Jettro CoenradieReturning the right results - Jettro Coenradie
Returning the right results - Jettro Coenradie
 
Reactive programming met Java 8 en Java EE 7 - Martijn Blankestijn
Reactive programming met Java 8 en Java EE 7 - Martijn BlankestijnReactive programming met Java 8 en Java EE 7 - Martijn Blankestijn
Reactive programming met Java 8 en Java EE 7 - Martijn Blankestijn
 

Full text search met ElasticSearch in de praktijk