弹性搜索清除单个查询项的缓存 [英] Elasticsearch clear cache for individual query term

查看:138
本文介绍了弹性搜索清除单个查询项的缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据弹性搜索清除缓存文档,您可以清除一个字段的缓存,但是可以清除单个查询项的缓存吗?

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?

为了防止将来出现此问题,我希望查询null不被缓存,或缓存更新频繁。是否可以以这种粒度级别设置缓存规则?

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.

您可以覆盖 _cache false 默认情况下启用缓存: http ://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-term-filter.html#_caching_18

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:

  • Optimizing Elasticsearch Searches: On the importance of filters and caching.
  • Elasticsearch from the Bottom Up: On how segments and caches work.

我想你会发现你不必担心要清除单个术语过滤器的缓存条目。

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.

这篇关于弹性搜索清除单个查询项的缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆