How to clear fielddata cache for one field


(Arun Agarwal) #1

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'

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

Any help will be appreciated


(Mark Walkom) #2

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


(Arun Agarwal) #3

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


(Mark Walkom) #4

There you go then!


(Arun Agarwal) #5

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


(system) #6