Projection on object fields: preserving the document structure in projections

Description

As of HSEARCH-3391, given the following document:

... you can retrieve all values of "authors.firstName" in a single list (List<String>, ["Daniel", "Ty"]), and you can retrieve all values of "authors.lastName" in another list (List<String>, ["Abraham", "Frank"]). These projections are effectively flattened, because the "authors" part of the structure is gone.

What you cannot do is retrieve all the pairs firstName/lastName (List<AuthorDto>, [AuthorDto(firstName = "Daniel", lastName = "Abraham"), AuthorDto(firstName = "Ty", lastName = "Frank")]). In order for that to be possible, we would need some way to tell Hibernate Search "these two fields must be grouped together for each author", similarly to the "nested" predicate.

Note that for the Elasticsearch backend we could make this "grouping" work regardless of whether "authors" is nested or flattened, because we have the full JSON. However, that's not the case for the Lucene backend.

Tickets depending on this:

Activity

Show:
Fixed

Details

Assignee

Reporter

Components

Sprint

Fix versions

Priority

Created June 9, 2020 at 8:37 AM
Updated July 4, 2022 at 7:01 AM
Resolved March 22, 2022 at 2:17 PM