要对es的查询性能做测试,需要排除缓存因素的干扰,请问怎么关闭缓存
可以更新已经有的索引的设定,让缓存失效
例如:
curl -X PUT "localhost:9200/my-index-000001/_settings?pretty" -H 'Content-Type: application/json' -d'
{ "index.requests.cache.enable": false }
PS:也可以在生成index时候指定不使用缓存;或者在请求查询中指定不使用缓存
详细参考:
https://www.elastic.co/guide/en/elasticsearch/reference/7.9/shard-request-cache.html