# Dfs\_query\_then\_fetch search type across multiple indexes

**URL:** <https://discuss.elastic.co/t/dfs-query-then-fetch-search-type-across-multiple-indexes/91342>\
**Category:** Elasticsearch\
**Created:** [June 29, 2017, 8:15pm UTC](https://discuss.elastic.co/t/dfs-query-then-fetch-search-type-across-multiple-indexes/91342 "2017-06-29T20:15:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajay\_bh111](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@ajay\_bh111](https://discuss.elastic.co/u/ajay_bh111)\
**Post date:** [June 29, 2017, 8:15pm UTC](https://discuss.elastic.co/t/dfs-query-then-fetch-search-type-across-multiple-indexes/91342/1 "2017-06-29T20:15:46Z")

</div>

Can some please tell me if using dfs\_query\_then\_fetch search type across multiple indexes the term frequencies are calculated across indexes or per index basis ? Is it possible to sort the result by term frequencies for a search query across multiple indices ?

For example if we have the following indices with the following index users

Index A  
John Smith  
Dan Smith  
Rachel Smith  
Sam Smith

Index B  
Steve Smith  
Jane Doe  
Ryan Johnson

And we do a prefix query for Smi\* it would have a higher score for the match in index B then in index A as the term is less frequent?

Thanks

---

<div class="post-metadata">

**Author:** ![s1monw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s1monw/32/3637_2.png) [@s1monw](https://discuss.elastic.co/u/s1monw)\
**Post date:** [July 7, 2017, 7:20am UTC](https://discuss.elastic.co/t/dfs-query-then-fetch-search-type-across-multiple-indexes/91342/2 "2017-07-07T07:20:09Z")

</div>

term frequencies are calculated across the set of shards in the search request no matter which index they belong to.

---

<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:** [August 4, 2017, 7:20am UTC](https://discuss.elastic.co/t/dfs-query-then-fetch-search-type-across-multiple-indexes/91342/3 "2017-08-04T07:20:30Z")

</div>

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