We're updating the issue view to help you get more done. 

Projection on multi-valued fields

Description

Historically projections on multi-valued have not been possible, see HSEARCH‌-1895 in particular. The exact reasons are a bit unclear.

It would be interesting to support them, especially in combination with the nested object field support.

Note that two cases, at least, should be considered:

1. Multi-valued fields on the root document
2. Single-valued fields in multi-valued nested documents

APIs and implementations are still TBD, but we'll most likely leverage the projection DSL ( HSEARCH‌-3222 ), in particular the composite projections ( HSEARCH‌-3390 ). We may have to rely on metadata telling us which field is potentially multi-valued and which is not, see HSEARCH‌-3324 .

WARNING: the existing code is optimized based on the assumption projected fields have only one value. In particular ReusableDocumentStoredFieldVisitor may fail to retrieve values beyond the first one, or succeed, depending on the case. Tests may not detect this problem, so we should have a very close look at this class.

Environment

None

Status

Assignee

Unassigned

Reporter

Yoann Rodière

Fix versions

Priority

Major