Won't Do
Details
Assignee
Yoann RodièreYoann RodièreReporter
Yoann RodièreYoann RodièreComponents
Priority
Major
Details
Details
Assignee
Yoann Rodière
Yoann RodièreReporter
Yoann Rodière
Yoann RodièreComponents
Priority
Created March 18, 2022 at 5:24 PM
Updated March 21, 2022 at 10:03 AM
Resolved March 21, 2022 at 10:03 AM
We have this code in
NestedDocsProvider
:public DocIdSetIterator childDocs(LeafReaderContext context) throws IOException { final IndexReaderContext topLevelCtx = ReaderUtil.getTopLevelContext( context ); // Maybe we can cache on shard-base. See Elasticsearch code. IndexSearcher indexSearcher = new IndexSearcher( topLevelCtx ); Weight weight = childDocsWeight( indexSearcher ); return childDocs( weight, context ); }
It’s very suspicious that we have to instantiate a new indexSearcher for every single leaf.
We should find a way to either:
pass the index searcher to the NestedDocsProvider constructor
pass the index searcher to the childDocs() method
make the index searcher available through the topLevelCtx (somehow?)