瀏覽代碼

parent/child: Explicitly disabled the query cache

It was already disabled, but during tests the test framework enabled the query cache by setting the static default query cache. The caching behaviour should be the same in production and in tests.
Martijn van Groningen 10 年之前
父節點
當前提交
e74f559fd4
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      core/src/main/java/org/elasticsearch/index/query/HasChildQueryParser.java

+ 1 - 0
core/src/main/java/org/elasticsearch/index/query/HasChildQueryParser.java

@@ -258,6 +258,7 @@ public class HasChildQueryParser implements QueryParser {
             String joinField = ParentFieldMapper.joinField(parentType);
             IndexReader indexReader = searchContext.searcher().getIndexReader();
             IndexSearcher indexSearcher = new IndexSearcher(indexReader);
+            indexSearcher.setQueryCache(null);
             IndexParentChildFieldData indexParentChildFieldData = parentChildIndexFieldData.loadGlobal(indexReader);
             MultiDocValues.OrdinalMap ordinalMap = ParentChildIndexFieldData.getOrdinalMap(indexParentChildFieldData, parentType);
             return JoinUtil.createJoinQuery(joinField, innerQuery, toQuery, indexSearcher, scoreMode, ordinalMap, minChildren, maxChildren);