SlideShare a Scribd company logo
1 of 45
Download to read offline
Search Evolution – von Lucene
  zu Solr und ElasticSearch




Florian Hopf
@fhopf
http://www.florian-hopf.de
Index




   Indizieren




                Index



    Suchen
Index


Term           Document Id
Analyzing




http://www.flickr.com/photos/quinnanya/5196951914/
Analyzing

    Such
 Evolution -
Von Lucene
 zu Solr und
ElasticSearch




  Verteiltes
 Suchen mit
Elasticsearch
Analyzing

    Such                          Term            Document Id
 Evolution -                      Such            1
Von Lucene      1. Tokenization
 zu Solr und                      Evolution       1
ElasticSearch                     Von             1
                                  Lucene          1
                                  zu              1
                                  Solr            1
                                  und             1
                                  ElasticSearch   1
 Verteiltes                       Verteiltes      2
Suchen mit
                                  Suchen          2
Elasticsearch
                                  mit             2
                                  Elasticsearch   2
Analyzing

    Such
 Evolution -                      Term            Document Id
Von Lucene      1. Tokenization   such            1
 zu Solr und
                                  evolution       1
ElasticSearch
                                  von             1

                2. Lowercasing    lucene          1
                                  zu              1
                                  solr            1
                                  und             1
                                  elasticsearch   1,2
 Verteiltes
Suchen mit                        verteiltes      2
Elasticsearch                     suchen          2
                                  mit             2
Analyzing

    Such
 Evolution -                      Term            Document Id
Von Lucene      1. Tokenization
 zu Solr und                      such            1,2
ElasticSearch                     evolution       1
                                  von             1
                2. Lowercasing    luc             1
                                  zu              1
                                  solr            1
                3. Stemming       und             1
 Verteiltes                       elasticsearch   1,2
Suchen mit
                                  verteilt        2
Elasticsearch
                                  mit             2
Inverted Index
Analyzer
Query Syntax



datenbank OR DB

title:elasticsearch

"apache lucene"

speaker:hopp~

elastic* AND date:[20130101 TO 20130501]
Relevance
http://www.ibm.com/developerworks/java/library/os-apache-lucenesearch/
Documents



Document
  Field title
      title     Integration1 Suchen mitmit Apache Camel
                    Verteiltes
                    Name ganz einfach Elasticsearch
                                Value      Value 1


  Field date
      title        Name 1     20130404
                               Value      Value 1


  Field title
     speaker
      title     Integration1 Halil-Cem mit Apache Camel
                    Name Dr. einfach Gürsoy 1
                            ganz Value     Value
Attributes


           NOT_ANALYZED




ANALYZED                  NO
             Index

                ...
Attributes




YES                NO
       Store
Indexing

Document es = new Document();
es.add(new Field("title",
   "Verteiltes Suchen mit Elasticsearch",
   Field.Store.YES,
   Field.Index.ANALYZED));
es.add(new Field("date",
   "20130404",
   Field.Store.NO,
   Field.Index.ANALYZED));
es.add(new Field("speaker",
   "Dr. Halil-Cem Gürsoy",
   Field.Store.YES,
   Field.Index.ANALYZED));
Indexing



Directory dir = FSDirectory.open(
   new File("/tmp/testindex"));
IndexWriterConfig config = new IndexWriterConfig(
   Version.LUCENE_36,
   new GermanAnalyzer(Version.LUCENE_36));
IndexWriter writer = new IndexWriter(dir, config);

writer.addDocument(es);

writer.commit();
Searching

IndexReader reader = IndexReader.open(dir);
IndexSearcher searcher = new IndexSearcher(reader);
QueryParser parser = new QueryParser(
     Version.LUCENE_36,
     "title",
     new GermanAnalyzer(Version.LUCENE_36));
Query query = parser.parse("suche");

TopDocs result = searcher.search(query, 10);
assertEquals(1, result.totalHits);

int id = result.scoreDocs[0].doc;
Document doc = searcher.doc(id);
String title = doc.get("title");
assertEquals(
     "Verteiltes Suchen mit Elasticsearch",
     title);
Webapp                                          Webapp
         XML, JSON, JavaBin, Ruby, ...




Client              http                 Solr            Lucene
Config



                    Solr Home




             conf                data



               solr-
schema.xml                      Lucene
             config.xml
Schema

schema.xml



      Field Types




         Fields
Schema



<fieldType name="text_de" class="solr.TextField">
   <analyzer>
      <tokenizer
         class="solr.StandardTokenizerFactory"/>
      <filter
         class="solr.LowerCaseFilterFactory"/>
      <filter
         class="solr.GermanLightStemFilterFactory"/>
   </analyzer>
</fieldType>
Schema


<fields>
   <field name="title" type="text_de"
     indexed="true" stored="true"/>
   <field name="speaker" type="string"
     indexed="true" stored="true"
     multiValued="true"/>
   <field name="speaker_search" type="text_ws"
     indexed="true" stored="false"
     multiValued="true"/>
     [...]
</fields>

<copyField source="speaker" dest="speaker_search"/>
Indexing

SolrInputDocument document =
           new SolrInputDocument();
document.addField("path",
           "/tmp/foo");
document.addField("title",
           "Verteiltes Suchen mit Elasticsearch");
document.addField("speaker",
           "Dr. Halil-Cem Gürsoy");

SolrServer server =
   new HttpSolrServer("http://localhost:8080");

server.add(document);
server.commit();
Solrconfig

solrconfig.xml


      Lucene Config
         Caches



     Request Handler




   Search Components
Solrconfig

<requestHandler name="/bedcon"
   class="solr.SearchHandler">
   <lst name="defaults">
      <int name="rows">10</int>
      <str name="q.op">AND</str>
      <str name="q.alt">*:*</str>
      <str name="defType">edismax</str>
      <str name="qf">
         content
         title^1.5
         speaker_search
      </str>
   </lst>
</requestHandler>
Searching


SolrQuery solrQuery = new SolrQuery("suche");
solrQuery.setQueryType("/bedcon");

QueryResponse response = server.query(solrQuery);
assertEquals(1, response.getResults().size());

SolrDocument result = response.getResults().get(0);
assertEquals("Verteiltes Suchen mit Elasticsearch",
             result.get("title"));
assertEquals("Dr. Halil-Cem Gürsoy",
             result.getFirstValue("speaker"));
Faceting


...

solrQuery.setFacet(true);
solrQuery.addFacetField("speaker");

QueryResponse response = server.query(solrQuery);
List<FacetField.Count> speakerFacet =
     response.getFacetField("speaker").getValues();
assertEquals(1, speakerFacet.get(0).getCount());
assertEquals("Dr. Halil-Cem Gürsoy",
     speakerFacet.get(0).getName());
Indexing


curl -XPOST
   'http://localhost:9200/bedcon/talk/' -d '{
    "speaker" :
        "Dr. Halil-Cem Gürsoy",
    "date"    :
        "2013-04-04T16:00:00",
    "title"   :
        "Verteiltes Suchen mit Elasticsearch"
}'

{"ok":true,"_index":"bedcon","_type":"talk",
"_id":"CeltdivQRGSvLY_dBZv1jw","_version":1}
Mapping


curl -XPUT
   'http://host/bedcon/talk/_mapping' -d '{
   "talk" : {
      "properties" : {
      "title" : {
           "type" : "string",
           "analyzer" : "german"
         }
      }
   }
}'
Searching
curl -XGET
   'http://host/bedcon/talk/_search?q=elasticsearch'
{...},
"hits":{"total":1,"max_score":0.054244425,
   "hits":[{
      ...,
      "_score":0.054244425,
      "_source" : {
         "speaker" :
            "Dr. Halil-Cem Gürsoy",
         "date" :
            "2013-04-04T16:00:00",
         "title":
            "Verteiltes Suchen mit Elasticsearch"
      }
   }
}
Searching


curl -XGET
'http://localhost:9200/bedcon/talk/_search' -d '{
   "query" : {
      "query_string" : {"query" : "elasticsearch"}
   },
   "facets" : {
      "tags" : {
         "terms" : {"field" : "speaker"}
      }
   }
}'
Searching



SearchResponse response =
   esClient.prepareSearch("bedcon")
   .addFacet(
      FacetBuilders.termsFacet("speaker")
                   .field("speaker"))
   .setQuery(
      QueryBuilders.queryString("elasticsearch"))
   .execute().actionGet();

assertEquals(1, response.getHits().getTotalHits());
Verteilung
Verteilung
http://lucene.apache.org
http://lucene.apache.org/solr/
http://elasticsearch.org
https://github.com/fhopf/lucene-solr-talk




@fhopf
mail@florian-hopf.de
http://blog.florian-hopf.de
Images

●   http://www.morguefile.com/archive/display/3470
●   http://www.flickr.com/photos/quinnanya/5196951914/
       Quinn Dombrowski
●   http://www.morguefile.com/archive/display/695239
●   http://www.morguefile.com/archive/display/93433
●   http://www.morguefile.com/archive/display/811746
●   http://www.morguefile.com/archive/display/12965
●   http://www.morguefile.com/archive/display/181488

More Related Content

What's hot

DevOps Fest 2019. Сергей Марченко. Terraform: a novel about modules, provider...
DevOps Fest 2019. Сергей Марченко. Terraform: a novel about modules, provider...DevOps Fest 2019. Сергей Марченко. Terraform: a novel about modules, provider...
DevOps Fest 2019. Сергей Марченко. Terraform: a novel about modules, provider...DevOps_Fest
 
Large Scale Log Analytics with Solr (from Lucene Revolution 2015)
Large Scale Log Analytics with Solr (from Lucene Revolution 2015)Large Scale Log Analytics with Solr (from Lucene Revolution 2015)
Large Scale Log Analytics with Solr (from Lucene Revolution 2015)Sematext Group, Inc.
 
How ElasticSearch lives in my DevOps life
How ElasticSearch lives in my DevOps lifeHow ElasticSearch lives in my DevOps life
How ElasticSearch lives in my DevOps life琛琳 饶
 
Asynchonicity: concurrency. A tale of
Asynchonicity: concurrency. A tale ofAsynchonicity: concurrency. A tale of
Asynchonicity: concurrency. A tale ofJoel Lord
 
Solr & Lucene @ Etsy by Gregg Donovan
Solr & Lucene @ Etsy by Gregg DonovanSolr & Lucene @ Etsy by Gregg Donovan
Solr & Lucene @ Etsy by Gregg DonovanGregg Donovan
 
Your Data, Your Search, ElasticSearch (EURUKO 2011)
Your Data, Your Search, ElasticSearch (EURUKO 2011)Your Data, Your Search, ElasticSearch (EURUKO 2011)
Your Data, Your Search, ElasticSearch (EURUKO 2011)Karel Minarik
 
From Zero to Production Hero: Log Analysis with Elasticsearch (from Velocity ...
From Zero to Production Hero: Log Analysis with Elasticsearch (from Velocity ...From Zero to Production Hero: Log Analysis with Elasticsearch (from Velocity ...
From Zero to Production Hero: Log Analysis with Elasticsearch (from Velocity ...Sematext Group, Inc.
 
MongoDB World 2016: Deciphering .explain() Output
MongoDB World 2016: Deciphering .explain() OutputMongoDB World 2016: Deciphering .explain() Output
MongoDB World 2016: Deciphering .explain() OutputMongoDB
 
Introduction to Apache Solr
Introduction to Apache SolrIntroduction to Apache Solr
Introduction to Apache SolrChristos Manios
 
Beyond full-text searches with Lucene and Solr
Beyond full-text searches with Lucene and SolrBeyond full-text searches with Lucene and Solr
Beyond full-text searches with Lucene and SolrBertrand Delacretaz
 
Introduction to the new official C# Driver developed by 10gen
Introduction to the new official C# Driver developed by 10genIntroduction to the new official C# Driver developed by 10gen
Introduction to the new official C# Driver developed by 10genMongoDB
 
ニコニコ動画を検索可能にしてみよう
ニコニコ動画を検索可能にしてみようニコニコ動画を検索可能にしてみよう
ニコニコ動画を検索可能にしてみようgenta kaneyama
 
10gen Presents Schema Design and Data Modeling
10gen Presents Schema Design and Data Modeling10gen Presents Schema Design and Data Modeling
10gen Presents Schema Design and Data ModelingDATAVERSITY
 
Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to ElasticsearchJason Austin
 
MongoDB Performance Tuning
MongoDB Performance TuningMongoDB Performance Tuning
MongoDB Performance TuningPuneet Behl
 
Stubる - Mockingjayを使ったHTTPクライアントのテスト -
Stubる - Mockingjayを使ったHTTPクライアントのテスト -Stubる - Mockingjayを使ったHTTPクライアントのテスト -
Stubる - Mockingjayを使ったHTTPクライアントのテスト -Kenji Tanaka
 

What's hot (20)

DevOps Fest 2019. Сергей Марченко. Terraform: a novel about modules, provider...
DevOps Fest 2019. Сергей Марченко. Terraform: a novel about modules, provider...DevOps Fest 2019. Сергей Марченко. Terraform: a novel about modules, provider...
DevOps Fest 2019. Сергей Марченко. Terraform: a novel about modules, provider...
 
Large Scale Log Analytics with Solr (from Lucene Revolution 2015)
Large Scale Log Analytics with Solr (from Lucene Revolution 2015)Large Scale Log Analytics with Solr (from Lucene Revolution 2015)
Large Scale Log Analytics with Solr (from Lucene Revolution 2015)
 
How ElasticSearch lives in my DevOps life
How ElasticSearch lives in my DevOps lifeHow ElasticSearch lives in my DevOps life
How ElasticSearch lives in my DevOps life
 
ElasticSearch
ElasticSearchElasticSearch
ElasticSearch
 
Elastic search
Elastic searchElastic search
Elastic search
 
Asynchonicity: concurrency. A tale of
Asynchonicity: concurrency. A tale ofAsynchonicity: concurrency. A tale of
Asynchonicity: concurrency. A tale of
 
Solr & Lucene @ Etsy by Gregg Donovan
Solr & Lucene @ Etsy by Gregg DonovanSolr & Lucene @ Etsy by Gregg Donovan
Solr & Lucene @ Etsy by Gregg Donovan
 
Your Data, Your Search, ElasticSearch (EURUKO 2011)
Your Data, Your Search, ElasticSearch (EURUKO 2011)Your Data, Your Search, ElasticSearch (EURUKO 2011)
Your Data, Your Search, ElasticSearch (EURUKO 2011)
 
From Zero to Production Hero: Log Analysis with Elasticsearch (from Velocity ...
From Zero to Production Hero: Log Analysis with Elasticsearch (from Velocity ...From Zero to Production Hero: Log Analysis with Elasticsearch (from Velocity ...
From Zero to Production Hero: Log Analysis with Elasticsearch (from Velocity ...
 
MongoDB World 2016: Deciphering .explain() Output
MongoDB World 2016: Deciphering .explain() OutputMongoDB World 2016: Deciphering .explain() Output
MongoDB World 2016: Deciphering .explain() Output
 
Elk stack
Elk stackElk stack
Elk stack
 
Introduction to Apache Solr
Introduction to Apache SolrIntroduction to Apache Solr
Introduction to Apache Solr
 
Beyond full-text searches with Lucene and Solr
Beyond full-text searches with Lucene and SolrBeyond full-text searches with Lucene and Solr
Beyond full-text searches with Lucene and Solr
 
Introduction to the new official C# Driver developed by 10gen
Introduction to the new official C# Driver developed by 10genIntroduction to the new official C# Driver developed by 10gen
Introduction to the new official C# Driver developed by 10gen
 
Oak Lucene Indexes
Oak Lucene IndexesOak Lucene Indexes
Oak Lucene Indexes
 
ニコニコ動画を検索可能にしてみよう
ニコニコ動画を検索可能にしてみようニコニコ動画を検索可能にしてみよう
ニコニコ動画を検索可能にしてみよう
 
10gen Presents Schema Design and Data Modeling
10gen Presents Schema Design and Data Modeling10gen Presents Schema Design and Data Modeling
10gen Presents Schema Design and Data Modeling
 
Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to Elasticsearch
 
MongoDB Performance Tuning
MongoDB Performance TuningMongoDB Performance Tuning
MongoDB Performance Tuning
 
Stubる - Mockingjayを使ったHTTPクライアントのテスト -
Stubる - Mockingjayを使ったHTTPクライアントのテスト -Stubる - Mockingjayを使ったHTTPクライアントのテスト -
Stubる - Mockingjayを使ったHTTPクライアントのテスト -
 

Viewers also liked

From Lucene to Elasticsearch, a short explanation of horizontal scalability
From Lucene to Elasticsearch, a short explanation of horizontal scalabilityFrom Lucene to Elasticsearch, a short explanation of horizontal scalability
From Lucene to Elasticsearch, a short explanation of horizontal scalabilityStéphane Gamard
 
Intro to Elasticsearch
Intro to ElasticsearchIntro to Elasticsearch
Intro to ElasticsearchClifford James
 
Elasticsearch Distributed search & analytics on BigData made easy
Elasticsearch Distributed search & analytics on BigData made easyElasticsearch Distributed search & analytics on BigData made easy
Elasticsearch Distributed search & analytics on BigData made easyItamar
 
Marketing Theories for Bangladesh
Marketing Theories for BangladeshMarketing Theories for Bangladesh
Marketing Theories for BangladeshDr Nahin Mamun
 
Rajesh & radha marriage invitation
Rajesh & radha marriage invitationRajesh & radha marriage invitation
Rajesh & radha marriage invitationrajeswaran6263nan
 
Serco corporate brochure
Serco corporate brochureSerco corporate brochure
Serco corporate brochureTony3773
 
The Case History of Noronha Advogados - Brazil's Global Law Firm
The Case History of Noronha Advogados - Brazil's Global Law FirmThe Case History of Noronha Advogados - Brazil's Global Law Firm
The Case History of Noronha Advogados - Brazil's Global Law FirmNoronha Noad
 
Unit 3 foundatio practice paper set_a_ mark_scheme
Unit 3 foundatio  practice paper set_a_ mark_schemeUnit 3 foundatio  practice paper set_a_ mark_scheme
Unit 3 foundatio practice paper set_a_ mark_schemeclaire meadows-smith
 
Fast Track Problem Solving in Bangladesh
Fast Track Problem Solving in BangladeshFast Track Problem Solving in Bangladesh
Fast Track Problem Solving in BangladeshDr Nahin Mamun
 
Performance Indicators for Bangladeshi People
Performance Indicators for Bangladeshi PeoplePerformance Indicators for Bangladeshi People
Performance Indicators for Bangladeshi PeopleDr Nahin Mamun
 
Mathura of my Dreams by Charul Agarwal
Mathura of my Dreams by Charul AgarwalMathura of my Dreams by Charul Agarwal
Mathura of my Dreams by Charul AgarwalPaarth Institute
 
Preparation for Fortnue
Preparation for FortnuePreparation for Fortnue
Preparation for FortnueDr Nahin Mamun
 
Probability
ProbabilityProbability
Probabilitycwalt54
 

Viewers also liked (20)

Elasticsearch Introduction
Elasticsearch IntroductionElasticsearch Introduction
Elasticsearch Introduction
 
From Lucene to Elasticsearch, a short explanation of horizontal scalability
From Lucene to Elasticsearch, a short explanation of horizontal scalabilityFrom Lucene to Elasticsearch, a short explanation of horizontal scalability
From Lucene to Elasticsearch, a short explanation of horizontal scalability
 
Intro to Elasticsearch
Intro to ElasticsearchIntro to Elasticsearch
Intro to Elasticsearch
 
Elasticsearch Distributed search & analytics on BigData made easy
Elasticsearch Distributed search & analytics on BigData made easyElasticsearch Distributed search & analytics on BigData made easy
Elasticsearch Distributed search & analytics on BigData made easy
 
Marketing Theories for Bangladesh
Marketing Theories for BangladeshMarketing Theories for Bangladesh
Marketing Theories for Bangladesh
 
Pesawat sederhana
Pesawat sederhanaPesawat sederhana
Pesawat sederhana
 
Rajesh & radha marriage invitation
Rajesh & radha marriage invitationRajesh & radha marriage invitation
Rajesh & radha marriage invitation
 
Serco corporate brochure
Serco corporate brochureSerco corporate brochure
Serco corporate brochure
 
ประวัติ
ประวัติประวัติ
ประวัติ
 
The Case History of Noronha Advogados - Brazil's Global Law Firm
The Case History of Noronha Advogados - Brazil's Global Law FirmThe Case History of Noronha Advogados - Brazil's Global Law Firm
The Case History of Noronha Advogados - Brazil's Global Law Firm
 
Talentpipeline
TalentpipelineTalentpipeline
Talentpipeline
 
Unit 3 foundatio practice paper set_a_ mark_scheme
Unit 3 foundatio  practice paper set_a_ mark_schemeUnit 3 foundatio  practice paper set_a_ mark_scheme
Unit 3 foundatio practice paper set_a_ mark_scheme
 
Crowns bridges2
Crowns bridges2Crowns bridges2
Crowns bridges2
 
Fast Track Problem Solving in Bangladesh
Fast Track Problem Solving in BangladeshFast Track Problem Solving in Bangladesh
Fast Track Problem Solving in Bangladesh
 
Performance Indicators for Bangladeshi People
Performance Indicators for Bangladeshi PeoplePerformance Indicators for Bangladeshi People
Performance Indicators for Bangladeshi People
 
Who am I?
Who am I?Who am I?
Who am I?
 
Absolute Lies
Absolute LiesAbsolute Lies
Absolute Lies
 
Mathura of my Dreams by Charul Agarwal
Mathura of my Dreams by Charul AgarwalMathura of my Dreams by Charul Agarwal
Mathura of my Dreams by Charul Agarwal
 
Preparation for Fortnue
Preparation for FortnuePreparation for Fortnue
Preparation for Fortnue
 
Probability
ProbabilityProbability
Probability
 

Similar to Search Evolution - Von Lucene zu Solr und ElasticSearch

JavaEdge09 : Java Indexing and Searching
JavaEdge09 : Java Indexing and SearchingJavaEdge09 : Java Indexing and Searching
JavaEdge09 : Java Indexing and SearchingShay Sofer
 
Using elasticsearch with rails
Using elasticsearch with railsUsing elasticsearch with rails
Using elasticsearch with railsTom Z Zeng
 
Wanna search? Piece of cake!
Wanna search? Piece of cake!Wanna search? Piece of cake!
Wanna search? Piece of cake!Alex Kursov
 
Introduction to Elasticsearch with basics of Lucene
Introduction to Elasticsearch with basics of LuceneIntroduction to Elasticsearch with basics of Lucene
Introduction to Elasticsearch with basics of LuceneRahul Jain
 
Infinispan,Lucene,Hibername OGM
Infinispan,Lucene,Hibername OGMInfinispan,Lucene,Hibername OGM
Infinispan,Lucene,Hibername OGMJBug Italy
 
code4lib 2011 preconference: What's New in Solr (since 1.4.1)
code4lib 2011 preconference: What's New in Solr (since 1.4.1)code4lib 2011 preconference: What's New in Solr (since 1.4.1)
code4lib 2011 preconference: What's New in Solr (since 1.4.1)Erik Hatcher
 
ElasticSearch Getting Started
ElasticSearch Getting StartedElasticSearch Getting Started
ElasticSearch Getting StartedOnuralp Taner
 
Introduction to Apache Lucene/Solr
Introduction to Apache Lucene/SolrIntroduction to Apache Lucene/Solr
Introduction to Apache Lucene/SolrRahul Jain
 
ElasticSearch Basics
ElasticSearch BasicsElasticSearch Basics
ElasticSearch BasicsAmresh Singh
 
Elastic search apache_solr
Elastic search apache_solrElastic search apache_solr
Elastic search apache_solrmacrochen
 
Basics of Solr and Solr Integration with AEM6
Basics of Solr and Solr Integration with AEM6Basics of Solr and Solr Integration with AEM6
Basics of Solr and Solr Integration with AEM6DEEPAK KHETAWAT
 
Solr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by CaseSolr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by CaseAlexandre Rafalovitch
 
Enterprise Search Solution: Apache SOLR. What's available and why it's so cool
Enterprise Search Solution: Apache SOLR. What's available and why it's so coolEnterprise Search Solution: Apache SOLR. What's available and why it's so cool
Enterprise Search Solution: Apache SOLR. What's available and why it's so coolEcommerce Solution Provider SysIQ
 
Lifecycle of a Solr Search Request - Chris "Hoss" Hostetter, Lucidworks
Lifecycle of a Solr Search Request - Chris "Hoss" Hostetter, LucidworksLifecycle of a Solr Search Request - Chris "Hoss" Hostetter, Lucidworks
Lifecycle of a Solr Search Request - Chris "Hoss" Hostetter, LucidworksLucidworks
 
JLIFF, Creating a JSON Serialization of OASIS XLIFF
JLIFF, Creating a JSON Serialization of OASIS XLIFFJLIFF, Creating a JSON Serialization of OASIS XLIFF
JLIFF, Creating a JSON Serialization of OASIS XLIFFDavid Filip
 

Similar to Search Evolution - Von Lucene zu Solr und ElasticSearch (20)

ElasticSearch Basics
ElasticSearch Basics ElasticSearch Basics
ElasticSearch Basics
 
JavaEdge09 : Java Indexing and Searching
JavaEdge09 : Java Indexing and SearchingJavaEdge09 : Java Indexing and Searching
JavaEdge09 : Java Indexing and Searching
 
Using elasticsearch with rails
Using elasticsearch with railsUsing elasticsearch with rails
Using elasticsearch with rails
 
Wanna search? Piece of cake!
Wanna search? Piece of cake!Wanna search? Piece of cake!
Wanna search? Piece of cake!
 
Introduction to Elasticsearch with basics of Lucene
Introduction to Elasticsearch with basics of LuceneIntroduction to Elasticsearch with basics of Lucene
Introduction to Elasticsearch with basics of Lucene
 
Infinispan,Lucene,Hibername OGM
Infinispan,Lucene,Hibername OGMInfinispan,Lucene,Hibername OGM
Infinispan,Lucene,Hibername OGM
 
code4lib 2011 preconference: What's New in Solr (since 1.4.1)
code4lib 2011 preconference: What's New in Solr (since 1.4.1)code4lib 2011 preconference: What's New in Solr (since 1.4.1)
code4lib 2011 preconference: What's New in Solr (since 1.4.1)
 
ElasticSearch Getting Started
ElasticSearch Getting StartedElasticSearch Getting Started
ElasticSearch Getting Started
 
Solr 8 interview
Solr 8 interview Solr 8 interview
Solr 8 interview
 
Introduction to Apache Lucene/Solr
Introduction to Apache Lucene/SolrIntroduction to Apache Lucene/Solr
Introduction to Apache Lucene/Solr
 
ElasticSearch Basics
ElasticSearch BasicsElasticSearch Basics
ElasticSearch Basics
 
Elastic search apache_solr
Elastic search apache_solrElastic search apache_solr
Elastic search apache_solr
 
Basics of Solr and Solr Integration with AEM6
Basics of Solr and Solr Integration with AEM6Basics of Solr and Solr Integration with AEM6
Basics of Solr and Solr Integration with AEM6
 
Solr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by CaseSolr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by Case
 
Elasto Mania
Elasto ManiaElasto Mania
Elasto Mania
 
Enterprise Search Solution: Apache SOLR. What's available and why it's so cool
Enterprise Search Solution: Apache SOLR. What's available and why it's so coolEnterprise Search Solution: Apache SOLR. What's available and why it's so cool
Enterprise Search Solution: Apache SOLR. What's available and why it's so cool
 
Lifecycle of a Solr Search Request - Chris "Hoss" Hostetter, Lucidworks
Lifecycle of a Solr Search Request - Chris "Hoss" Hostetter, LucidworksLifecycle of a Solr Search Request - Chris "Hoss" Hostetter, Lucidworks
Lifecycle of a Solr Search Request - Chris "Hoss" Hostetter, Lucidworks
 
Lucene intro
Lucene introLucene intro
Lucene intro
 
JLIFF, Creating a JSON Serialization of OASIS XLIFF
JLIFF, Creating a JSON Serialization of OASIS XLIFFJLIFF, Creating a JSON Serialization of OASIS XLIFF
JLIFF, Creating a JSON Serialization of OASIS XLIFF
 
Elasticsearch
ElasticsearchElasticsearch
Elasticsearch
 

More from Florian Hopf

Modern Java Features
Modern Java Features Modern Java Features
Modern Java Features Florian Hopf
 
Einführung in Elasticsearch
Einführung in ElasticsearchEinführung in Elasticsearch
Einführung in ElasticsearchFlorian Hopf
 
Introduction to elasticsearch
Introduction to elasticsearchIntroduction to elasticsearch
Introduction to elasticsearchFlorian Hopf
 
Java clients for elasticsearch
Java clients for elasticsearchJava clients for elasticsearch
Java clients for elasticsearchFlorian Hopf
 
Einfuehrung in Elasticsearch
Einfuehrung in ElasticsearchEinfuehrung in Elasticsearch
Einfuehrung in ElasticsearchFlorian Hopf
 
Data modeling for Elasticsearch
Data modeling for ElasticsearchData modeling for Elasticsearch
Data modeling for ElasticsearchFlorian Hopf
 
Einführung in Elasticsearch
Einführung in ElasticsearchEinführung in Elasticsearch
Einführung in ElasticsearchFlorian Hopf
 
Elasticsearch und die Java-Welt
Elasticsearch und die Java-WeltElasticsearch und die Java-Welt
Elasticsearch und die Java-WeltFlorian Hopf
 
Anwendungsfälle für Elasticsearch JAX 2015
Anwendungsfälle für Elasticsearch JAX 2015Anwendungsfälle für Elasticsearch JAX 2015
Anwendungsfälle für Elasticsearch JAX 2015Florian Hopf
 
Anwendungsfälle für Elasticsearch JavaLand 2015
Anwendungsfälle für Elasticsearch JavaLand 2015Anwendungsfälle für Elasticsearch JavaLand 2015
Anwendungsfälle für Elasticsearch JavaLand 2015Florian Hopf
 
Anwendungsfaelle für Elasticsearch
Anwendungsfaelle für ElasticsearchAnwendungsfaelle für Elasticsearch
Anwendungsfaelle für ElasticsearchFlorian Hopf
 
Search Evolution - Von Lucene zu Solr und ElasticSearch (Majug 20.06.2013)
Search Evolution - Von Lucene zu Solr und ElasticSearch (Majug 20.06.2013)Search Evolution - Von Lucene zu Solr und ElasticSearch (Majug 20.06.2013)
Search Evolution - Von Lucene zu Solr und ElasticSearch (Majug 20.06.2013)Florian Hopf
 
Akka Presentation Schule@synyx
Akka Presentation Schule@synyxAkka Presentation Schule@synyx
Akka Presentation Schule@synyxFlorian Hopf
 
Lucene Solr talk at Java User Group Karlsruhe
Lucene Solr talk at Java User Group KarlsruheLucene Solr talk at Java User Group Karlsruhe
Lucene Solr talk at Java User Group KarlsruheFlorian Hopf
 

More from Florian Hopf (14)

Modern Java Features
Modern Java Features Modern Java Features
Modern Java Features
 
Einführung in Elasticsearch
Einführung in ElasticsearchEinführung in Elasticsearch
Einführung in Elasticsearch
 
Introduction to elasticsearch
Introduction to elasticsearchIntroduction to elasticsearch
Introduction to elasticsearch
 
Java clients for elasticsearch
Java clients for elasticsearchJava clients for elasticsearch
Java clients for elasticsearch
 
Einfuehrung in Elasticsearch
Einfuehrung in ElasticsearchEinfuehrung in Elasticsearch
Einfuehrung in Elasticsearch
 
Data modeling for Elasticsearch
Data modeling for ElasticsearchData modeling for Elasticsearch
Data modeling for Elasticsearch
 
Einführung in Elasticsearch
Einführung in ElasticsearchEinführung in Elasticsearch
Einführung in Elasticsearch
 
Elasticsearch und die Java-Welt
Elasticsearch und die Java-WeltElasticsearch und die Java-Welt
Elasticsearch und die Java-Welt
 
Anwendungsfälle für Elasticsearch JAX 2015
Anwendungsfälle für Elasticsearch JAX 2015Anwendungsfälle für Elasticsearch JAX 2015
Anwendungsfälle für Elasticsearch JAX 2015
 
Anwendungsfälle für Elasticsearch JavaLand 2015
Anwendungsfälle für Elasticsearch JavaLand 2015Anwendungsfälle für Elasticsearch JavaLand 2015
Anwendungsfälle für Elasticsearch JavaLand 2015
 
Anwendungsfaelle für Elasticsearch
Anwendungsfaelle für ElasticsearchAnwendungsfaelle für Elasticsearch
Anwendungsfaelle für Elasticsearch
 
Search Evolution - Von Lucene zu Solr und ElasticSearch (Majug 20.06.2013)
Search Evolution - Von Lucene zu Solr und ElasticSearch (Majug 20.06.2013)Search Evolution - Von Lucene zu Solr und ElasticSearch (Majug 20.06.2013)
Search Evolution - Von Lucene zu Solr und ElasticSearch (Majug 20.06.2013)
 
Akka Presentation Schule@synyx
Akka Presentation Schule@synyxAkka Presentation Schule@synyx
Akka Presentation Schule@synyx
 
Lucene Solr talk at Java User Group Karlsruhe
Lucene Solr talk at Java User Group KarlsruheLucene Solr talk at Java User Group Karlsruhe
Lucene Solr talk at Java User Group Karlsruhe
 

Recently uploaded

Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 

Recently uploaded (20)

Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 

Search Evolution - Von Lucene zu Solr und ElasticSearch

  • 1. Search Evolution – von Lucene zu Solr und ElasticSearch Florian Hopf @fhopf http://www.florian-hopf.de
  • 2.
  • 3.
  • 4. Index Indizieren Index Suchen
  • 5. Index Term Document Id
  • 7. Analyzing Such Evolution - Von Lucene zu Solr und ElasticSearch Verteiltes Suchen mit Elasticsearch
  • 8. Analyzing Such Term Document Id Evolution - Such 1 Von Lucene 1. Tokenization zu Solr und Evolution 1 ElasticSearch Von 1 Lucene 1 zu 1 Solr 1 und 1 ElasticSearch 1 Verteiltes Verteiltes 2 Suchen mit Suchen 2 Elasticsearch mit 2 Elasticsearch 2
  • 9. Analyzing Such Evolution - Term Document Id Von Lucene 1. Tokenization such 1 zu Solr und evolution 1 ElasticSearch von 1 2. Lowercasing lucene 1 zu 1 solr 1 und 1 elasticsearch 1,2 Verteiltes Suchen mit verteiltes 2 Elasticsearch suchen 2 mit 2
  • 10. Analyzing Such Evolution - Term Document Id Von Lucene 1. Tokenization zu Solr und such 1,2 ElasticSearch evolution 1 von 1 2. Lowercasing luc 1 zu 1 solr 1 3. Stemming und 1 Verteiltes elasticsearch 1,2 Suchen mit verteilt 2 Elasticsearch mit 2
  • 11.
  • 14. Query Syntax datenbank OR DB title:elasticsearch "apache lucene" speaker:hopp~ elastic* AND date:[20130101 TO 20130501]
  • 17. Documents Document Field title title Integration1 Suchen mitmit Apache Camel Verteiltes Name ganz einfach Elasticsearch Value Value 1 Field date title Name 1 20130404 Value Value 1 Field title speaker title Integration1 Halil-Cem mit Apache Camel Name Dr. einfach Gürsoy 1 ganz Value Value
  • 18. Attributes NOT_ANALYZED ANALYZED NO Index ...
  • 19. Attributes YES NO Store
  • 20. Indexing Document es = new Document(); es.add(new Field("title", "Verteiltes Suchen mit Elasticsearch", Field.Store.YES, Field.Index.ANALYZED)); es.add(new Field("date", "20130404", Field.Store.NO, Field.Index.ANALYZED)); es.add(new Field("speaker", "Dr. Halil-Cem Gürsoy", Field.Store.YES, Field.Index.ANALYZED));
  • 21. Indexing Directory dir = FSDirectory.open( new File("/tmp/testindex")); IndexWriterConfig config = new IndexWriterConfig( Version.LUCENE_36, new GermanAnalyzer(Version.LUCENE_36)); IndexWriter writer = new IndexWriter(dir, config); writer.addDocument(es); writer.commit();
  • 22. Searching IndexReader reader = IndexReader.open(dir); IndexSearcher searcher = new IndexSearcher(reader); QueryParser parser = new QueryParser( Version.LUCENE_36, "title", new GermanAnalyzer(Version.LUCENE_36)); Query query = parser.parse("suche"); TopDocs result = searcher.search(query, 10); assertEquals(1, result.totalHits); int id = result.scoreDocs[0].doc; Document doc = searcher.doc(id); String title = doc.get("title"); assertEquals( "Verteiltes Suchen mit Elasticsearch", title);
  • 23.
  • 24.
  • 25. Webapp Webapp XML, JSON, JavaBin, Ruby, ... Client http Solr Lucene
  • 26. Config Solr Home conf data solr- schema.xml Lucene config.xml
  • 27. Schema schema.xml Field Types Fields
  • 28. Schema <fieldType name="text_de" class="solr.TextField"> <analyzer> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.GermanLightStemFilterFactory"/> </analyzer> </fieldType>
  • 29. Schema <fields> <field name="title" type="text_de" indexed="true" stored="true"/> <field name="speaker" type="string" indexed="true" stored="true" multiValued="true"/> <field name="speaker_search" type="text_ws" indexed="true" stored="false" multiValued="true"/> [...] </fields> <copyField source="speaker" dest="speaker_search"/>
  • 30. Indexing SolrInputDocument document = new SolrInputDocument(); document.addField("path", "/tmp/foo"); document.addField("title", "Verteiltes Suchen mit Elasticsearch"); document.addField("speaker", "Dr. Halil-Cem Gürsoy"); SolrServer server = new HttpSolrServer("http://localhost:8080"); server.add(document); server.commit();
  • 31. Solrconfig solrconfig.xml Lucene Config Caches Request Handler Search Components
  • 32. Solrconfig <requestHandler name="/bedcon" class="solr.SearchHandler"> <lst name="defaults"> <int name="rows">10</int> <str name="q.op">AND</str> <str name="q.alt">*:*</str> <str name="defType">edismax</str> <str name="qf"> content title^1.5 speaker_search </str> </lst> </requestHandler>
  • 33. Searching SolrQuery solrQuery = new SolrQuery("suche"); solrQuery.setQueryType("/bedcon"); QueryResponse response = server.query(solrQuery); assertEquals(1, response.getResults().size()); SolrDocument result = response.getResults().get(0); assertEquals("Verteiltes Suchen mit Elasticsearch", result.get("title")); assertEquals("Dr. Halil-Cem Gürsoy", result.getFirstValue("speaker"));
  • 34.
  • 35. Faceting ... solrQuery.setFacet(true); solrQuery.addFacetField("speaker"); QueryResponse response = server.query(solrQuery); List<FacetField.Count> speakerFacet = response.getFacetField("speaker").getValues(); assertEquals(1, speakerFacet.get(0).getCount()); assertEquals("Dr. Halil-Cem Gürsoy", speakerFacet.get(0).getName());
  • 36.
  • 37. Indexing curl -XPOST 'http://localhost:9200/bedcon/talk/' -d '{ "speaker" : "Dr. Halil-Cem Gürsoy", "date" : "2013-04-04T16:00:00", "title" : "Verteiltes Suchen mit Elasticsearch" }' {"ok":true,"_index":"bedcon","_type":"talk", "_id":"CeltdivQRGSvLY_dBZv1jw","_version":1}
  • 38. Mapping curl -XPUT 'http://host/bedcon/talk/_mapping' -d '{ "talk" : { "properties" : { "title" : { "type" : "string", "analyzer" : "german" } } } }'
  • 39. Searching curl -XGET 'http://host/bedcon/talk/_search?q=elasticsearch' {...}, "hits":{"total":1,"max_score":0.054244425, "hits":[{ ..., "_score":0.054244425, "_source" : { "speaker" : "Dr. Halil-Cem Gürsoy", "date" : "2013-04-04T16:00:00", "title": "Verteiltes Suchen mit Elasticsearch" } } }
  • 40. Searching curl -XGET 'http://localhost:9200/bedcon/talk/_search' -d '{ "query" : { "query_string" : {"query" : "elasticsearch"} }, "facets" : { "tags" : { "terms" : {"field" : "speaker"} } } }'
  • 41. Searching SearchResponse response = esClient.prepareSearch("bedcon") .addFacet( FacetBuilders.termsFacet("speaker") .field("speaker")) .setQuery( QueryBuilders.queryString("elasticsearch")) .execute().actionGet(); assertEquals(1, response.getHits().getTotalHits());
  • 45. Images ● http://www.morguefile.com/archive/display/3470 ● http://www.flickr.com/photos/quinnanya/5196951914/ Quinn Dombrowski ● http://www.morguefile.com/archive/display/695239 ● http://www.morguefile.com/archive/display/93433 ● http://www.morguefile.com/archive/display/811746 ● http://www.morguefile.com/archive/display/12965 ● http://www.morguefile.com/archive/display/181488