Avoid filtering out nested documents in Lucene queries when we know there are none

Description

We currently always add a filter to Lucene queries, to make sure only "root" documents are returned.
This filter is obviously unnecessary when there are only "root" documents because there are no "nested" @IndexedEmbedded.

It turns out we can get a small, but noticeable performance improvement for MatchAllDocs queries by removing this filter. It also brings us closer to Search 5 performance for this particular type of query.

Tested with an Infinispan performance test:

  • Without filter:

  • With filter:

Environment

None

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Priority

Major
Configure