Don't scan index leaves that don't contain topdocs when applying projections

Description

The weight returned by org.hibernate.search.backend.lucene.lowlevel.query.impl.ExplicitDocIdsQuery#createWeight will always return a non-null scorer, even when the index leaf does not contain any relevant topdoc.

This might lead to scanning leaves unnecessarily: opening docvalues, etc.

We should return null when we can, since it may improve performance.

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