Lucene projections on fields in nested documents should limit children collection to the top docs

Description

Currently we have something like this in LuceneSearcherImpl:

And findChildQuery does this:

This code doesn't take the top docs into account, so we will always retrieve the children for all documents, even if the query was limited to the 20 top documents.
This may add up and lead to poor performance in large indexes, where we would retrieve the children of millions of documents.

The current version of findChildQuery is fine for sorts and aggregations, where we need to inspect all documents, but we should definitely add another version that only returns the IDs of a specific subset of documents, for use in

Activity

Show:
Fixed

Details

Assignee

Reporter

Components

Sprint

Fix versions

Priority

Created December 10, 2019 at 10:18 AM
Updated January 22, 2020 at 2:18 PM
Resolved January 6, 2020 at 12:57 PM