newbie
newbie

Reputation: 375

How does elasticsearch multi search work?

How does it work in the background? Lets say it has two queries. Would the total time taken be

1) network latency + time for query1 + time for query2

or

2) network latency + max(time for query1, time for query2)

I am assuming its the later but couldn't find any documentation to confirm that.

Upvotes: 2

Views: 322

Answers (1)

Alex Brasetvik
Alex Brasetvik

Reputation: 11744

The total time is the network latency and the slowest of the searches, as can be seen in the implementation of TransportMultiSearchAction.

Note that searches can be routed to other nodes in the cluster, and network latency is of course a factor then as well. See the preference search parameter to control that.

Upvotes: 2

Related Questions