Elasticsearch: What is the "took" value for multi-search query

Created on 12 Feb 2017  路  7Comments  路  Source: elastic/elasticsearch

When we execute a search query on elasticsearch cluster, "took" field shows the time in milliseconds the query has taken to execute. I believe its equal to the sum of _time spent in search queue (if any) + time taken in query phase + time taken in fetch phase_ considering the search type is query_then_fetch.

However, msearch API doesn't expose any feature like "took" to find out total time taken by the multi-search query. How do we know how much time multi-search query took. Is it equal to the sum of "took" value of all the individual queries (which, I believe, shouldn't be the case as queries run in parallel) or maximum of all the individual query's "took" value or something else? If answer is something else then wouldn't it be helpful to add "took" field for msearch API as well.

:SearcSearch >enhancement good first issue help wanted

Most helpful comment

@amirhmd no need to be sorry. These are not trivial things. I presume you want to tackle this issue. Do note that it is labeled with discuss, so I'm not sure people are happy with the feature just yet. But assuming this is what you want to promote, I think OK To proceed. First thing, if you didn't already do it, I would start with reading https://github.com/elastic/elasticsearch/blob/master/CONTRIBUTING.md and making sure you have a working environment. Once you did that, try to follow the _msearch logic. Start with RestMultiSearchAction. Let me know when you are ready to proceed.

All 7 comments

The took value is neither the sum nor the max of the individual took values, as the number of searches which are executed in parallel is constrained. Perhaps we could add an overall took response.

Thanks for the response clintongormley.

Actually we are running a multi-search query comprised of 6 individual queries. "took" value of each individual query is in the range of 50-150 milliseconds but total time that we are measuring in our Java code for the execution of the multi-search request is in the range of 3-5 seconds. From an elastic forum post we got to know that this total time may also includes _serialization/de-serialization/network round trip_ times but we would also like to know the time taken by multi-search query only on ES cluster.

Could you please provide any clues why execution time of multi-search query is so high as compared to the comprising individual queries?

Hey guys, sorry, is there any body who could help me getting started with contributing to this project? i am very looking forward to contributing in this project but I am new and i am not very high in experience.

@amirhmd no need to be sorry. These are not trivial things. I presume you want to tackle this issue. Do note that it is labeled with discuss, so I'm not sure people are happy with the feature just yet. But assuming this is what you want to promote, I think OK To proceed. First thing, if you didn't already do it, I would start with reading https://github.com/elastic/elasticsearch/blob/master/CONTRIBUTING.md and making sure you have a working environment. Once you did that, try to follow the _msearch logic. Start with RestMultiSearchAction. Let me know when you are ready to proceed.

I would like to have a look at this issue iff @amirhmd is not already working on it.

Hi @olcbean, i ve been into something else lately. Please go ahead. Thanks.

Closed by #23767

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ppf2 picture ppf2  路  3Comments

jpountz picture jpountz  路  3Comments

makeyang picture makeyang  路  3Comments

ttaranov picture ttaranov  路  3Comments

rjernst picture rjernst  路  3Comments