# Index.queries.cache.term\_queries

**URL:** https://discuss.elastic.co/t/index-queries-cache-term-queries/98451
**Category:** Elasticsearch
**Created:** [August 26, 2017, 11:48am UTC](https://discuss.elastic.co/t/index-queries-cache-term-queries/98451 "2017-08-26T11:48:47Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Sundar\_V](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sundar_v/32/6928_2.png) [@Sundar\_V](https://discuss.elastic.co/u/Sundar_V)
#### Post date: [August 26, 2017, 11:48am UTC](https://discuss.elastic.co/t/index-queries-cache-term-queries/98451/1 "2017-08-26T11:48:47Z")

</div>

After our initial migration from ES 2 to 5, one major issue that we faced was that the term queries were very slow in comparison to ES 2.

I had raised a GtitHub issue [https://github.com/elastic/elasticsearch/issues/23343](https://github.com/elastic/elasticsearch/issues/23343) and after jpountz pointed me to the below property, then our performance improved.

I see the following code in ES source at core/src/main/java/org/elasticsearch/index/IndexModule.java: 107

```
// This setting is an escape hatch in case not caching term queries would slow some users down
// Do not document.
public static final Setting<Boolean> INDEX_QUERY_CACHE_TERM_QUERIES_SETTING =
    Setting.boolSetting("index.queries.cache.term_queries", false, Property.IndexScope);

```

I'm only concerned that since this is not documented, that it may end up being removed in the future ES.

We have more than 200 million documents and our majority (99%) of the tasks are term queries only. Could someone please consider to document this support and maintain it in future ES as well.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [August 26, 2017, 12:11pm UTC](https://discuss.elastic.co/t/index-queries-cache-term-queries/98451/2 "2017-08-26T12:11:28Z")

</div>

We'd definitely encourage you to raise a PR with changes to the docs so we can include it 🙂

---

<div class="post-metadata">

### Author: ![Sundar\_V](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sundar_v/32/6928_2.png) [@Sundar\_V](https://discuss.elastic.co/u/Sundar_V)
#### Post date: [August 26, 2017, 12:13pm UTC](https://discuss.elastic.co/t/index-queries-cache-term-queries/98451/3 "2017-08-26T12:13:37Z")

</div>

Great! The reason I asked was, in the comments in the source code it was explicitly written as "Do not document". If you folks are open to documenting this, I will raise the PR. Thanks 😀

---

<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: [September 23, 2017, 12:14pm UTC](https://discuss.elastic.co/t/index-queries-cache-term-queries/98451/4 "2017-09-23T12:14:05Z")

</div>

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