Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In case of a single type the _id field should be added to the nested document instead of _uid field #25149

Conversation

@martijnvg
Copy link
Member

commented Jun 9, 2017

When index.mapping.single_type is true the _uid field is not used and instead _id field is used.
Prior to this change nested documents would in this case still use the _uid field to mark to what root
document they belong to. In case of deleting documents this could lead to only the root Lucene document
to be deleted and not the nested Lucene documents. This broke the docid block ordering the block join
relies on in order to work correctly and thus causing the nested query, nested aggregation, nested sorting
and nested inner hits to either fail or yield incorrect results.

This bug only manifests in 6.0.0-ALPHA2 release and snaphots (5.5.0-SNAPSHOT, 5.6.0-SNAPSHOT, 6.0.0-SNAPSHOT).

@jpountz
jpountz approved these changes Jun 9, 2017
Copy link
Contributor

left a comment

LGTM!

@martijnvg martijnvg force-pushed the martijnvg:nested_single_type__add_id_field_instead_of_uid_field branch Jun 9, 2017
… nested document instead of _uid field.

When `index.mapping.single_type` is `true` the `_uid` field is not used and instead `_id` field is used.
Prior to this change nested documents would in this case still use the `_uid` field to mark to what root
document they belong to. In case of deleting documents this could lead to only the root  Lucene document
to be deleted and not the nested Lucene documents. This broke the docid block ordering the block join
relies on in order to work correctly and thus causing the `nested` query, `nested` aggregation, nested sorting
and nested inner hits to either fail or yield incorrect results.

This bug only manifests in 6.0.0-ALPHA2 release and snaphots (5.5.0-SNAPSHOT, 5.6.0-SNAPSHOT, 6.0.0-SNAPSHOT).
@martijnvg martijnvg force-pushed the martijnvg:nested_single_type__add_id_field_instead_of_uid_field branch to c7ae27d Jun 9, 2017
@martijnvg martijnvg merged commit c7ae27d into elastic:master Jun 9, 2017
1 of 2 checks passed
1 of 2 checks passed
elasticsearch-ci Build started sha1 is merged.
Details
CLA Commit author is a member of Elasticsearch
Details
@clintongormley clintongormley added v6.0.0-beta1 and removed v6.0.0 labels Jul 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.