Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The clear_cache API doesn't clear fielddata cache by default #2886

Closed
clintongormley opened this issue Apr 12, 2013 · 0 comments
Closed

The clear_cache API doesn't clear fielddata cache by default #2886

clintongormley opened this issue Apr 12, 2013 · 0 comments

Comments

@clintongormley
Copy link

In 0.90.RC3, a call to clear the cache without specifying any options doesn't clear the fielddata cache, but it does in v0.20.6:

curl -XPUT 'http://127.0.0.1:9200/test/?pretty=1'  -d '
{
   "settings" : {
      "number_of_shards" : 1
   }
}
'

curl -XPOST 'http://127.0.0.1:9200/test/test/_bulk?pretty=1'  -d '
{"index" : {}}
{"num" : 1}
{"index" : {}}
{"num" : 2}
{"index" : {}}
{"num" : 3}
{"index" : {}}
{"num" : 4}
{"index" : {}}
{"num" : 5}
{"index" : {}}
{"num" : 6}
{"index" : {}}
{"num" : 7}
{"index" : {}}
{"num" : 8}
{"index" : {}}
{"num" : 9}
{"index" : {}}
{"num" : 10}
{"index" : {}}
{"num" : 11}
{"index" : {}}
{"num" : 12}
{"index" : {}}
{"num" : 13}
{"index" : {}}
{"num" : 14}
{"index" : {}}
{"num" : 15}
{"index" : {}}
{"num" : 16}
{"index" : {}}
{"num" : 17}
{"index" : {}}
{"num" : 18}
{"index" : {}}
{"num" : 19}
{"index" : {}}
{"num" : 20}
{"index" : {}}
{"num" : 21}
{"index" : {}}
{"num" : 22}
{"index" : {}}
{"num" : 23}
{"index" : {}}
{"num" : 24}
{"index" : {}}
{"num" : 25}
{"index" : {}}
{"num" : 26}
{"index" : {}}
{"num" : 27}
{"index" : {}}
{"num" : 28}
{"index" : {}}
{"num" : 29}
{"index" : {}}
{"num" : 30}
{"index" : {}}
{"num" : 31}
{"index" : {}}
{"num" : 32}
{"index" : {}}
{"num" : 33}
{"index" : {}}
{"num" : 34}
{"index" : {}}
{"num" : 35}
{"index" : {}}
{"num" : 36}
{"index" : {}}
{"num" : 37}
{"index" : {}}
{"num" : 38}
{"index" : {}}
{"num" : 39}
{"index" : {}}
{"num" : 40}
{"index" : {}}
{"num" : 41}
{"index" : {}}
{"num" : 42}
{"index" : {}}
{"num" : 43}
{"index" : {}}
{"num" : 44}
{"index" : {}}
{"num" : 45}
{"index" : {}}
{"num" : 46}
{"index" : {}}
{"num" : 47}
{"index" : {}}
{"num" : 48}
{"index" : {}}
{"num" : 49}
{"index" : {}}
{"num" : 50}
{"index" : {}}
{"num" : 51}
{"index" : {}}
{"num" : 52}
{"index" : {}}
{"num" : 53}
{"index" : {}}
{"num" : 54}
{"index" : {}}
{"num" : 55}
{"index" : {}}
{"num" : 56}
{"index" : {}}
{"num" : 57}
{"index" : {}}
{"num" : 58}
{"index" : {}}
{"num" : 59}
{"index" : {}}
{"num" : 60}
{"index" : {}}
{"num" : 61}
{"index" : {}}
{"num" : 62}
{"index" : {}}
{"num" : 63}
{"index" : {}}
{"num" : 64}
{"index" : {}}
{"num" : 65}
{"index" : {}}
{"num" : 66}
{"index" : {}}
{"num" : 67}
{"index" : {}}
{"num" : 68}
{"index" : {}}
{"num" : 69}
{"index" : {}}
{"num" : 70}
{"index" : {}}
{"num" : 71}
{"index" : {}}
{"num" : 72}
{"index" : {}}
{"num" : 73}
{"index" : {}}
{"num" : 74}
{"index" : {}}
{"num" : 75}
{"index" : {}}
{"num" : 76}
{"index" : {}}
{"num" : 77}
{"index" : {}}
{"num" : 78}
{"index" : {}}
{"num" : 79}
{"index" : {}}
{"num" : 80}
{"index" : {}}
{"num" : 81}
{"index" : {}}
{"num" : 82}
{"index" : {}}
{"num" : 83}
{"index" : {}}
{"num" : 84}
{"index" : {}}
{"num" : 85}
{"index" : {}}
{"num" : 86}
{"index" : {}}
{"num" : 87}
{"index" : {}}
{"num" : 88}
{"index" : {}}
{"num" : 89}
{"index" : {}}
{"num" : 90}
{"index" : {}}
{"num" : 91}
{"index" : {}}
{"num" : 92}
{"index" : {}}
{"num" : 93}
{"index" : {}}
{"num" : 94}
{"index" : {}}
{"num" : 95}
{"index" : {}}
{"num" : 96}
{"index" : {}}
{"num" : 97}
{"index" : {}}
{"num" : 98}
{"index" : {}}
{"num" : 99}
{"index" : {}}
{"num" : 100}
'

curl -XGET 'http://127.0.0.1:9200/test/test/_search?pretty=1'  -d '
{
   "facets" : {
      "foo" : {
         "terms" : {
            "field" : "num"
         }
      }
   },
   "size" : 0
}
'

In 0.90.RC3, a clear cache request without params:

curl -XPOST 'http://127.0.0.1:9200/_cache/clear?pretty=1' 

The fielddata is not cleared:

curl -XGET 'http://127.0.0.1:9200/_cluster/nodes/stats?pretty=1&clear=true&indices=true' 

#             "fielddata" : {
#                "evictions" : 0,
#                "memory_size_in_bytes" : 120,
#                "memory_size" : "120b"
#             },

It is cleared when specifying field_data:

curl -XPOST 'http://127.0.0.1:9200/_cache/clear?field_data=true&pretty=1' 

curl -XGET 'http://127.0.0.1:9200/_cluster/nodes/stats?pretty=1&clear=true&indices=true' 

#             "fielddata" : {
#                "evictions" : 0,
#                "memory_size_in_bytes" : 0,
#                "memory_size" : "0b"
#             },

In 0.20.6, it is cleared even though field_data is not specified:

#             "cache" : {
#                "id_cache_size_in_bytes" : 0,
#                "field_evictions" : 0,
#                "field_size_in_bytes" : 0,
#                "id_cache_size" : "0b",
#                "field_size" : "0b",
#                "filter_count" : 0,
#                "filter_size" : "40b",
#                "bloom_size" : "0b",
#                "bloom_size_in_bytes" : 0,
#                "filter_size_in_bytes" : 40,
#                "filter_evictions" : 0
#             }

The docs http://www.elasticsearch.org/guide/reference/api/admin-indices-clearcache/ say "The clear cache API allows to clear either all caches..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant