I have one query _search with four separated nested terms aggregation and filters in the aggregations, this query is retrieving data in about 2 seconds when a specific term is searched.
I splitted the four queries into four different requests in a _msearch, each one with an aggregation. The time has reduced to about 25% of the previous one with all aggregations in a single request _search.
Regarding it, my question is, does aggregations in elasticsearch runs in parallel in the _search endpoint?
My guess is that when running the aggregations in a _msearch it was done in parallel and that is the reason to be faster. Am I right?
@jessepeixoto
_search aggregates run sequentially. _msearch they do run in parallel and you can control how many can in concurrently using max_concurrent_searches
Each query executes in a single thread against each shard, although querying of multiple shards is done in parallel. If you send 4 separate aggregation in parallel over in an _msearch query they run in parallel across all shards.
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.