Yoann Rodière (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate Search (
https://hibernate.atlassian.net/browse/HSEARCH?atlOrigin=eyJpIjoiOGRlOGY5...
) / Improvement (
https://hibernate.atlassian.net/browse/HSEARCH-3955?atlOrigin=eyJpIjoiOGR...
) HSEARCH-3955 (
https://hibernate.atlassian.net/browse/HSEARCH-3955?atlOrigin=eyJpIjoiOGR...
) Object fields that are both nested and flattened (ES's include_in_parent) (
https://hibernate.atlassian.net/browse/HSEARCH-3955?atlOrigin=eyJpIjoiOGR...
)
Issue Type: Improvement Assignee: Unassigned Components: backend-elasticsearch,
backend-lucene, engine Created: 18/Jun/2020 23:38 PM Fix Versions: 6.x-backlog Priority:
Major Reporter: Yoann Rodière (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
While nested documents provide additional features, we don't needed nested documents
for *everything*. Predicates on a single field when we're not using the nested
predicate, in particular, work perfectly well on flattened object fields, and actually
perform better since we don't need a runtime join.
To get the best of both worlds, when one can spare the extra disk space it requires, we
could allow object fields to be stored *both* as a nested document and flattened in their
parent. Elasticsearch allows that with the attribute include_in_parent (see
https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.ht...
).
API-wise, this could just be an additional value for the ObjectStructure enum:
ObjectStructure.NESTED_AND_FLATTENED. We could then take advantage of this internally:
when nesting is not necessary (no nested predicate, no filter in sorts and aggregations),
we can just use the flattened field.
(
https://hibernate.atlassian.net/browse/HSEARCH-3955#add-comment?atlOrigin...
) Add Comment (
https://hibernate.atlassian.net/browse/HSEARCH-3955#add-comment?atlOrigin...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100130- sha1:5f5b10c )