Projecting an unstored field should raise an exception with Elasticsearch

Description

Currently projecting an unstored fields works with Elasticsearch, because we use the "_source" for extracting the results anyway. So the field storage is never used, actually. See for details.

Anyway, I think we should enforce storing those fields, be it only to shield us from a future issue with the current retrieval method, that would force us to do it the "right" way.

A test case is provided in org.hibernate.search.test.query.ProjectionQueryTest: projectingUnstoredField. The test was disabled as part of HSEARCH-2406, but it should be re-enabled when this issue (HSEARCH-2423) has been fixed.

Environment

None

Status

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Affects versions

5.6.0.Beta3

Priority

Major
Configure