We're currently evaluating elastic 1.7 vs solr 5. One of the use cases are Facets/Aggregations with filters. When filter is set for faceted/aggregated filter it should be excluded, so we won't get just one result.
In solr we're achieving it using filter tagging as follows:
Apologies in advance, I'm not super familar with Solr's syntax. But I'm pretty sure those queries are asking for different results. The solr query is asking for:
All search hits which have field_1:"3098"
All terms in field_1 whose documents match FILTER2 + FILTER3
All terms in field_2 whose documents match FILTER1 + FILTER3
All terms in field_2 whose documents match FILTER1 + FILTER2
You have some syntax problems, but assuming the hierarchy means nesting, your Elasticsearch aggregation is asking for:
All search hits in the index (no filter)
All terms in field_1
All terms in field_2 whose documents match field_1:3102
For each term in the previous aggregation, generate all terms in field_3
A more comparable query would look something like this (annotated with comments):
Now, as far as performance, it's pretty hard to compare. ES is distributed by nature, while Solr has the benefit of being monolithic. If I understand correctly, Solr also includes a certain amount of aggressive caching that is invalidated when you index new documents, so comparisons can easily be skewed if you are just running searches.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.