# Search query not doing fetches

**URL:** <https://discuss.elastic.co/t/search-query-not-doing-fetches/101947>\
**Category:** Elasticsearch\
**Created:** [September 27, 2017, 8:14am UTC](https://discuss.elastic.co/t/search-query-not-doing-fetches/101947 "2017-09-27T08:14:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![toka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/toka/32/15773_2.png) [@toka](https://discuss.elastic.co/u/toka)\
**Post date:** [September 27, 2017, 8:14am UTC](https://discuss.elastic.co/t/search-query-not-doing-fetches/101947/1 "2017-09-27T08:14:49Z")

</div>

Hi guys,

I'm checking through the field `search.fetch_total` of the `_nodes/stats` API how many fetches a search query is triggering, but it's not triggering any fetch.

I tried to add different filters with random values to make sure that they are not cached, also cleaned the cache just in case, but still the same.

Also, even if the query is being cached, I thought that the fetch phase is necessary anyway.

Why is that happening? Is it related to some different kind of caching (OS cache, etc)?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![toka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/toka/32/15773_2.png) [@toka](https://discuss.elastic.co/u/toka)\
**Post date:** [October 2, 2017, 2:45am UTC](https://discuss.elastic.co/t/search-query-not-doing-fetches/101947/2 "2017-10-02T02:45:07Z")

</div>

I think I found out that File System Cache is not related.

Tried to restart the operating system, which causes the file system cache to be trashed; but even after that it has the same behavior (no fetches).

---

<div class="post-metadata">

**Author:** ![johtani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johtani/32/44956_2.png) [@johtani](https://discuss.elastic.co/u/johtani)\
**Post date:** [October 2, 2017, 5:09am UTC](https://discuss.elastic.co/t/search-query-not-doing-fetches/101947/3 "2017-10-02T05:09:35Z")

</div>

That is how many times call fetch in fetch phase.  
You should read [https://www.elastic.co/guide/en/elasticsearch/guide/2.x/\_fetch\_phase.html](https://www.elastic.co/guide/en/elasticsearch/guide/2.x/_fetch_phase.html) .  
And [https://www.elastic.co/guide/en/elasticsearch/guide/2.x/distributed-search.html](https://www.elastic.co/guide/en/elasticsearch/guide/2.x/distributed-search.html) .

And Es cache document is [https://www.elastic.co/guide/en/elasticsearch/reference/5.6/shard-request-cache.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/shard-request-cache.html)

---

<div class="post-metadata">

**Author:** ![toka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/toka/32/15773_2.png) [@toka](https://discuss.elastic.co/u/toka)\
**Post date:** [October 2, 2017, 5:25am UTC](https://discuss.elastic.co/t/search-query-not-doing-fetches/101947/4 "2017-10-02T05:25:36Z")

</div>

Thanks for the answer.

In the link about `Shard request cache ` it says:

> By default, the requests cache will only cache the results of search requests where size=0, so it will not cache hits, but it will cache hits.total, aggregations, and suggestions.

In my case, the size of the query is more than 0, so I guess the request is not being cached. Still wondering why any fetches are being triggered.

---

<div class="post-metadata">

**Author:** ![toka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/toka/32/15773_2.png) [@toka](https://discuss.elastic.co/u/toka)\
**Post date:** [October 11, 2017, 7:40am UTC](https://discuss.elastic.co/t/search-query-not-doing-fetches/101947/5 "2017-10-11T07:40:29Z")

</div>

Any thoughts?

---

<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:** [November 8, 2017, 7:40am UTC](https://discuss.elastic.co/t/search-query-not-doing-fetches/101947/6 "2017-11-08T07:40:54Z")

</div>

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