[hibernate-issues] [JIRA] (HSEARCH-3955) Object fields that are both nested and flattened (ES's include_in_parent)

Yoann Rodière (JIRA) jira at hibernate.atlassian.net
Fri Jun 19 02:38:42 EDT 2020


Yoann Rodière ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A58fa1ced-171a-4c00-97e8-5d70d442cc4b ) *created* an issue

Hibernate Search ( https://hibernate.atlassian.net/browse/HSEARCH?atlOrigin=eyJpIjoiOGRlOGY5MWE5NTJiNGIwYTgxN2Y0M2E4MmUxNzM1NDQiLCJwIjoiaiJ9 ) / Improvement ( https://hibernate.atlassian.net/browse/HSEARCH-3955?atlOrigin=eyJpIjoiOGRlOGY5MWE5NTJiNGIwYTgxN2Y0M2E4MmUxNzM1NDQiLCJwIjoiaiJ9 ) HSEARCH-3955 ( https://hibernate.atlassian.net/browse/HSEARCH-3955?atlOrigin=eyJpIjoiOGRlOGY5MWE5NTJiNGIwYTgxN2Y0M2E4MmUxNzM1NDQiLCJwIjoiaiJ9 ) Object fields that are both nested and flattened (ES's include_in_parent) ( https://hibernate.atlassian.net/browse/HSEARCH-3955?atlOrigin=eyJpIjoiOGRlOGY5MWE5NTJiNGIwYTgxN2Y0M2E4MmUxNzM1NDQiLCJwIjoiaiJ9 )

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%3A58fa1ced-171a-4c00-97e8-5d70d442cc4b )

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.html#nested-params ).

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=eyJpIjoiOGRlOGY5MWE5NTJiNGIwYTgxN2Y0M2E4MmUxNzM1NDQiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HSEARCH-3955#add-comment?atlOrigin=eyJpIjoiOGRlOGY5MWE5NTJiNGIwYTgxN2Y0M2E4MmUxNzM1NDQiLCJwIjoiaiJ9 )

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.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100130- sha1:5f5b10c )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200619/3d185370/attachment.html 


More information about the hibernate-issues mailing list