elasticsearch.

anticipate issues. scale faster.






-elasticsearch is a search engine built ontop of Apache's Lucene library


-elasticsearch uses Lucene internally for all of its indexing and searching, and also aims to make full text search easy by hiding Lucene's complexities behind a simple, coherent API

what is elasticsearch?


  • elasticsearch provides a distributed, multitenant-capable full-text search engine with a RESTful web interface and schema-free JSON documents



  • Faceted Search
  • Distributed Search
  • Scalable Search

Faceted Search


  • Combining Navigational & Direct search paradigms
    • Navigational Search
      • Enable users to browse information space by narrowing the scope of their quest in a predetermined order
    • Direct Search
      • Queries = bag of words in a text box

Distributed Search

    • Indices can be divided into shards     
    •                                                                                                                                                      

Scalable Search

-querying denormalized data (JSON)


use of inverted indexing


-elasticsearch uses a structure called an inverted index which is designed to allow very fast full text searches

elasticsearch relevance example

-query for 'rock climbing' in the employees collection
GET /megacorp/employee/_search
{
   
"query" : {
       
"match" : {
           
"about" : "rock climbing"
       
}
   
}
}

query example result

{
   
...
   
"hits": {
     
"total":      2,
     
"max_score":  0.16273327,
     
"hits": [
         
{
           
...
           
"_score":         0.16273327,
           
"_source": {
               
"first_name":  "John",
               
"last_name":   "Smith",
               
"age":         25,
               
"about":       "I love to go rock climbing",
               
"interests": [ "sports", "music" ]
           
}
         
},
         
{
           
...
           
"_score":         0.016878016,
           
"_source": {
               
"first_name":  "Jane",
               
"last_name":   "Smith",
               
"age":         32,
               
"about":       "I like to collect rock albums",
               
"interests": [ "music" ]
           
}
         
}
     
]
   
}
}
Made with Slides.com