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

Fix `copy_to` behavior on nested documents. #7079

Closed
wants to merge 2 commits into from

Conversation

Projects
None yet
3 participants
@jpountz
Copy link
Contributor

commented Jul 29, 2014

Today, copy_to always copies a field to the current document, which is often
wrong in the case of nested documents. For example, if you have a nested field
called n which has a sub-field n.source whose content should be copied to
target, then the latter field should be created in the root document instead
of the nested one, since it doesn't have n. as a prefix. On the contrary, if
you configure the destination field to be n.target, then it should go to the
nested document.

Close #6701

Mappings: Fix `copy_to` behavior on nested documents.
Today, `copy_to` always copies a field to the current document, which is often
wrong in the case of nested documents. For example, if you have a nested field
called `n` which has a sub-field `n.source` whose content should be copied to
`target`, then the latter field should be created in the root document instead
of the nested one, since it doesn't have `n.` as a prefix. On the contrary, if
you configure the destination field to be `n.target`, then it should go to the
nested document.

Close #6701
@clintongormley

This comment has been minimized.

Copy link
Member

commented Jul 29, 2014

w00t

@jpountz jpountz added the review label Jul 29, 2014

private final List<IndexableField> fields;
private ObjectObjectMap<Object, IndexableField> keyedFields;

public Document() {
public Document(String path, Document parent) {

This comment has been minimized.

Copy link
@martijnvg

martijnvg Jul 29, 2014

Member

Maybe add a default constructor for the places we don't supply a path or parent?

@martijnvg

This comment has been minimized.

Copy link
Member

commented Jul 29, 2014

Left a comment, other then that LGTM!

@jpountz

This comment has been minimized.

Copy link
Contributor Author

commented Jul 29, 2014

@martijnvg pushed a new commit

@jpountz jpountz removed the review label Jul 29, 2014

@martijnvg

This comment has been minimized.

Copy link
Member

commented Jul 29, 2014

@jpountz +1 the commit looks good

@jpountz jpountz added bug and removed review labels Jul 30, 2014

@jpountz jpountz closed this Aug 1, 2014

@jpountz jpountz deleted the jpountz:fix/copy_to_nested branch Aug 1, 2014

@clintongormley clintongormley changed the title Mappings: Fix `copy_to` behavior on nested documents. Mapping: Fix `copy_to` behavior on nested documents. Sep 8, 2014

@clintongormley clintongormley changed the title Mapping: Fix `copy_to` behavior on nested documents. Fix `copy_to` behavior on nested documents. Jun 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.