简体   繁体   中英

Elasticsearch clear cache for individual query term

According to the Elasticsearch clear cache docs , you can clear the cache for a field, but is it possible to clear the cache for a single query term?

And to prevent the problem in the future, I'd prefer that a query of "null" not be cached, or that the cache be updated quite frequently. Is it possible to set rules for the cache at that level of granularity?

No, you cannot specify that level of granularity.

You can override _cache to be false for filters that enable caching by default: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-term-filter.html#_caching_18

What do you mean with "cache updated frequently"? The caches are scoped to the segment, meaning they are valid as long as the segment is valid.

To learn more about both caching, filters, the benefits and downsides of immutable segments, here's some articles to look into:

I think you'll find that you don't need to worry a lot about having to clear a single term-filter's cache entry.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM