Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

elasticsearch vs solr regarding data structure/query features

I've seen many questions (and good answers) comparing the scalability, speed, and deployment scenarios for elasticsearch and Solr, but I can't seem to find good information regarding any differences or relative strengths of how queries are able to work with the indexed data.

Specifically, I'm interested in differences between elasticsearch and Solr in the following areas:

  1. faceting capabilities: how do their handling of faceting differ, or are they basically the same?

  2. schema handling: seems that elasticsearch has a flexibility edge in that schemas can be defined on the fly via the rest API, whereas Solr requires them to be pre-defined in schemas.xml (I haven't seen specific confirmation of this difference, though). Are there substantive differences in how schemas are used beyond that?

  3. indexing filters: are there differences between how data can be optimized for specific searches? e.g. I've seen mention of things like field duplication and query tokenization filters for Solr that add to the search algorithm's customizability, but haven't seen much info of the same sort regarding elasticsearch, but maybe it just handles all this stuff automatically?

  4. query expressivity: are the query DSLs basically just as expressive as each other, or are there fundamental differences?

  5. "boosting" and/or result customization: what facilities are there for hardcoding or massaging the algorithmic search results?

Again, please note that I'm not at all interested in speed/scalbility/performace issues, just the expressivity of the search data structuring and query language--Possibly this whole question could be summarized as: is there a search I can perform or a data structure I can create in elasticsearch that I cannot replicate in Solr, or vice-versa?

like image 951
Connie Dobbs Avatar asked Dec 09 '11 18:12

Connie Dobbs


People also ask

What are the differences between Elasticsearch and Solr?

The main difference between Solr and Elasticsearch is that Solr is a completely open-source search engine. Whereas Elasticsearch though open source is still managed by Elastic's employees. Solr supports text search while Elasticsearch is mainly used for analytical querying, filtering, and grouping.

What is the main architectural difference between Elasticsearch and Solr?

1 Ingest and Query services. The Elasticsearch query process is structured very similarly to the Solr service. The main difference lies in the microservice architecture of the system, and the exits to the Elasticsearch and the ZooKeeper administrative functions, rather than to Solr and the monolithic search server.

Is Solr faster than Elasticsearch?

Performance-wise, they are roughly the same. Operationally, Elasticsearch is a bit simpler to work with, it has just a single process. Solr, in its Elasticsearch-like fully distributed deployment mode known as SolrCloud, depends on Apache ZooKeeper.

What is Elasticsearch query?

Elasticsearch provides a full Query DSL (Domain Specific Language) based on JSON to define queries. Think of the Query DSL as an AST (Abstract Syntax Tree) of queries, consisting of two types of clauses: Leaf query clauses.


1 Answers

  1. faceting is nearly the same, except that ES allows it also via dynamic scripts and Solr allows facet pagination. Also in Solr there is a convenient facetting schema to do simple shop search style faceting (note: it is also relative easy with ES but not out of the box). ES faceting can be more powerful as there is no need to bind facets to the filterquery.

  2. for ES schema can be updated via API! or define it in a file and is specified for a type. for Solr you create a config file per index. BTW: with dynamic fields your have a less restrictive schema for Solr.

  3. ES misses only the autowarming feature (but this is performance related so not interesting for you ;)) and the group by feature. Otherwise both uses similar lucene stuff. ES allows a lot advanced combinations like it is possible in lucene. Parent child is similar to the group by feature and is not implemented in Solr IMO.

  4. The standard query for ES is formulated via JSON and so you can create nearly everything which you could create via lucene. In Solr you can do a lot of advanced stuff but often you need some fundamental knowledge of Solr stuff like local params etc. Have a look into this nice discussion.

  5. Do not understand this :)

is there a search I can perform or a data structure I can create in elasticsearch that I cannot replicate in Solr, or vice-versa?

In ES there is the percolator feature which is probably harder to implement with Solr. In ES you also have the versioning feature to implement optimistic locking, you have index aliasing and a scan query to deeply navigate through your index - not sure if Solr has similar features. E.g. the aliasing helps to make a rolling index implementation. relative short.

like image 155
Karussell Avatar answered Oct 03 '22 20:10

Karussell