Question about some details for Query Phase

Dear All,

Could you let me know how to process "Query Phase" exactly when an index has replicas?
For all I know, The coordinating node sends Query to every shard for Query Phase.
I want to understand the exact meaning of every shard for Query phase.

For example, an Index of 2 shards(P0, P1) and 1 replica(R0, R1) is allocated in 4 Nodes like below.

  • Node_A : P1
  • Node_B : R0
  • Node_C : R1
  • Node_D : P0

Let's suppose that Node_C receives a search request(i.e., Node_C is the coordinating node now).

Q1 : Does Node_C send Query request to all shards(P1, R0, R1, P0) or to just 2 shards(e.g., "P1 and R0" or "R1 and P0")?
If the latter, how does ES decide 2 shards to send Query request?

Q2 : If the query type is DFS_Query_then_Fetch, are the target shards for Pre-Query also same with the shards for Query?

Thanks for your help always.

For Q1, the search uses "adaptive replica selection" by default, which sends the query to the "best" shards

Thanks for your reply.
Do you mean that the coordinating node sends Query to only 2 shards in case of my example?
(2 shards is selected by "adaptive replica selection")

For what I understand, yes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.