Currently projecting an unstored fields works Elasticsearch, because we use the "_source" for extracting the results anyway. So the field storage is never used, actually. See HSEARCH-2358 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}} (which is being adapted to work on Elasticsearch : {{projectingUnstoredField}}. The test was disabled as part of HSEARCH- 2393 2406, but it should be re-enabled when this issue ({{HSEARCH-2423}} ) has been fixed . |
|