Skip to content

Commit

Permalink
Fix skip caching factor with indices.queries.cache.all_segments (elas…
Browse files Browse the repository at this point in the history
…tic#85510)

The indices.queries.cache.all_segments setting should not be used 
in production environments. And we should also use the default 
skipCachingFactor (i.e, 10) for when that setting is enabled.
  • Loading branch information
dnhatn committed Apr 1, 2022
1 parent b20abe9 commit 4a3f9bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/changelog/85510.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 85510
summary: Fix skip caching factor with `indices.queries.cache.all_segments`
area: Search
type: bug
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ public IndicesQueryCache(Settings settings) {
final int count = INDICES_CACHE_QUERY_COUNT_SETTING.get(settings);
logger.debug("using [node] query cache with size [{}] max filter count [{}]", size, count);
if (INDICES_QUERIES_CACHE_ALL_SEGMENTS_SETTING.get(settings)) {
cache = new ElasticsearchLRUQueryCache(count, size.getBytes(), context -> true, 1f);
// Use the default skip_caching_factor (i.e., 10f) in Lucene
cache = new ElasticsearchLRUQueryCache(count, size.getBytes(), context -> true, 10f);
} else {
cache = new ElasticsearchLRUQueryCache(count, size.getBytes());
}
Expand Down

0 comments on commit 4a3f9bb

Please sign in to comment.