# How to clear fielddata cache for one field

**URL:** https://discuss.elastic.co/t/how-to-clear-fielddata-cache-for-one-field/37904
**Category:** Elasticsearch
**Created:** [December 24, 2015, 3:21am UTC](https://discuss.elastic.co/t/how-to-clear-fielddata-cache-for-one-field/37904 "2015-12-24T03:21:49Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Arun\_Agarwal](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@Arun\_Agarwal](https://discuss.elastic.co/u/Arun_Agarwal)
#### Post date: [December 24, 2015, 3:21am UTC](https://discuss.elastic.co/t/how-to-clear-fielddata-cache-for-one-field/37904/1 "2015-12-24T03:21:49Z")

</div>

Hey  
I wanted to know how to clear fielddata cache for one field in a index.  
This field is storing the parent\_child relation.  
I have tried the following command

```
  "total" : {
    "fielddata" : {
      "memory_size_in_bytes" : 43175832,
      "evictions" : 4,
      "fields" : {
        "m_d" : {
          "memory_size_in_bytes" : 6510880
        },
        "c_d" : {
          "memory_size_in_bytes" : 5251516
        },
        "kind" : {
          "memory_size_in_bytes" : 669328
        },
        "_parent" : {
          "memory_size_in_bytes" : 3343924
        },
        "nm.srt" : {
          "memory_size_in_bytes" : 30744108
        },
        "sz" : {
          "memory_size_in_bytes" : 0
        },
        "contdt" : {
          "memory_size_in_bytes" : 0
        }
      }
    }
  }
}

```

curl -k -XPOST '[https://localhost:9200/\_cache/clear?fielddata=false&id\_cache=true&filter=false&query\_cache=false&pretty=true](https://localhost:9200/_cache/clear?fielddata=false&id_cache=true&filter=false&query_cache=false&pretty=true)'

in the above fielddata i want to clear the \_parent field,

Any help will be appreciated

---

<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: [December 24, 2015, 3:44am UTC](https://discuss.elastic.co/t/how-to-clear-fielddata-cache-for-one-field/37904/2 "2015-12-24T03:44:25Z")

</div>

I don't believe you can clear cache per field?

---

<div class="post-metadata">

### Author: ![Arun\_Agarwal](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@Arun\_Agarwal](https://discuss.elastic.co/u/Arun_Agarwal)
#### Post date: [December 24, 2015, 4:13am UTC](https://discuss.elastic.co/t/how-to-clear-fielddata-cache-for-one-field/37904/3 "2015-12-24T04:13:28Z")

</div>

[https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-clearcache.html](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-clearcache.html)  
this mentions that we can

---

<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: [December 24, 2015, 5:40am UTC](https://discuss.elastic.co/t/how-to-clear-fielddata-cache-for-one-field/37904/4 "2015-12-24T05:40:14Z")

</div>

There you go then!

---

<div class="post-metadata">

### Author: ![Arun\_Agarwal](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@Arun\_Agarwal](https://discuss.elastic.co/u/Arun_Agarwal)
#### Post date: [December 24, 2015, 5:51am UTC](https://discuss.elastic.co/t/how-to-clear-fielddata-cache-for-one-field/37904/5 "2015-12-24T05:51:48Z")

</div>

Well the problem is when i mention the fields parameter, it does not honor that and clears the entire cache, and some time it clears the cache for certain fields only

---

<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: [July 5, 2017, 11:28pm UTC](https://discuss.elastic.co/t/how-to-clear-fielddata-cache-for-one-field/37904/6 "2017-07-05T23:28:55Z")

</div>


