# Question about prequery of DFS\_Query\_then\_Fetch

**URL:** <https://discuss.elastic.co/t/question-about-prequery-of-dfs-query-then-fetch/228287>\
**Category:** Elasticsearch\
**Created:** [April 16, 2020, 9:20am UTC](https://discuss.elastic.co/t/question-about-prequery-of-dfs-query-then-fetch/228287 "2020-04-16T09:20:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hyunsoo\_Shim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hyunsoo_shim/32/55197_2.png) [@Hyunsoo\_Shim](https://discuss.elastic.co/u/Hyunsoo_Shim)\
**Post date:** [April 16, 2020, 9:20am UTC](https://discuss.elastic.co/t/question-about-prequery-of-dfs-query-then-fetch/228287/1 "2020-04-16T09:20:18Z")

</div>

Hello,  
I have a simple question about **"prequery"** step of "DFS\_Query\_then\_Fetch" search type.  
When we create an index of only 1 primary shard and make 4 replicas,  
is **"prequery"** excuted for all 5 shards(primary and replicas) in this case?

Thanks for your help always!

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 16, 2020, 9:44am UTC](https://discuss.elastic.co/t/question-about-prequery-of-dfs-query-then-fetch/228287/2 "2020-04-16T09:44:06Z")

</div>

If you only have 1 primary shard you do not need dfs\_query\_then\_fetch as only one of the shards serve each query.

---

<div class="post-metadata">

**Author:** ![Hyunsoo\_Shim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hyunsoo_shim/32/55197_2.png) [@Hyunsoo\_Shim](https://discuss.elastic.co/u/Hyunsoo_Shim)\
**Post date:** [April 16, 2020, 10:33am UTC](https://discuss.elastic.co/t/question-about-prequery-of-dfs-query-then-fetch/228287/3 "2020-04-16T10:33:31Z")

</div>

Thanks for your reply.

The situation I wrote was just example.  
So, Could I think that "prequery" is excuted for all shards(primary and replicas)?

And is there any problem to get consistent scoring in case of 1 primary shard?  
According to the below reference, I just knew that 1 primary shard might also have same issue.  
[https://www.elastic.co/guide/en/elasticsearch/reference/6.5/consistent-scoring.html#\_scores\_are\_not\_reproducible](https://www.elastic.co/guide/en/elasticsearch/reference/6.5/consistent-scoring.html#_scores_are_not_reproducible)

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 16, 2020, 10:38am UTC](https://discuss.elastic.co/t/question-about-prequery-of-dfs-query-then-fetch/228287/4 "2020-04-16T10:38:08Z")

</div>

If you only query a single shard your scoring will be consistent. Only a single copy of each shard (primary or replica) is queries so the answer is one.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 14, 2020, 10:38am UTC](https://discuss.elastic.co/t/question-about-prequery-of-dfs-query-then-fetch/228287/5 "2020-05-14T10:38:09Z")

</div>

Closed on May 14, 2020, 10:38am UTC

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