简体   繁体   English

Elasticsearch清除单个查询词的缓存

[英]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? 根据Elasticsearch clear cache docs ,您可以清除字段的缓存,但是是否可以为单个查询词清除缓存?

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. 为了防止将来出现此问题,我希望不要对“ null”查询进行缓存,或者不经常对缓存进行更新。 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 对于默认启用缓存的过滤器,您可以将_cache覆盖为falsehttp : _cache

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. 我认为您会发现不必担心必须清除单个术语过滤器的缓存条目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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