Is there any significance for search to be executed in two phases - "query then fetch" when the default number of shards as 1 ( starting from 7.x ) ? leaving the cases of considering replicas
Is there any significance for search to be executed in two phases - "query then fetch" when the default number of shards as 1 ( starting from 7.x ) ? leaving the cases of considering replicas
query than fetch is the default search type and yes you are right in case of single primary shard it doesn't make a difference whether you use this default or DFS Query Then Fetch as result will be the same.
Refer Elastic official blog on difference b/w query than fetch and DFS query than fetch.
But what if you increase or change the default number of the primary shards, then you will see the difference in your search results as in this case Elaticsearch will have to query more than shards(it can be primary or replica shard).
You should not be confused with Replicas as it just contains the copy of primary shard and when the search happens it wither query the primary shard or replica shard, so in this case it will not make any difference as at the end its just a shard which is being queried.