How Search Works in ElasticSearch and Solr

Searching is one of the most important functions of any software.  If you cannot find your documents and other information, then how can you be productive?  This makes it crucial to have a reliable and accurate search application.  We have been following two of the biggest names in open source search technology, Solr and ElasticSearch.  The Sematext Blog looks at the search capabilities of these two in “Solr vs. ElasticSearch: Part 3-Searching.” Part 3 focuses on the ability to match queries to documents and retrieve them.

Both ElasticSearch and Solr expose their search APIs with HTTP.  ElasticSearch is more structured for precise control, while Solr uses query parser to get the query out of the textual value of the “q” URL parameter.  As with any search engine, the basic search functions are available: Boolean, phrase, fuzz, wildcards, etc., plus span queries provided by Lucene.  Each handles the “more like this” option differently: Solr treats it like a search component, while ElasticSearch makes it an ordinary function.  ElasticSearch allows nested queries of its indexing nested documents, though Solr does not have this option.  Filtering is feature common to both, but ElasticSearch has its differences with the nested documents.

When it comes down to it:

As you can see, both ElasticSearch and Apache Solr expose lots of functionality when it comes to handling your search queries, and we barely scratched the surface here. Of course, each of them has some features that the other one doesn’t have, but Solr and ElasticSearch are competing for mind and market share, and are both rapidly evolving and improving, so we can expect more features from both of them in the future.

Both search applications were designed to handle any type of search query, but each does have its own individual flaws. If you think Apache Lucene is the search engine path you want to take for your project, LucidWorks’ software will already have most of the work done for you.

Whitney Grace, October 22, 2012

Sponsored by ArnoldIT.com, developer of Augmentext.