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

Return the _source of inner hit nested as is without wrapping it into its full path context #26982

Merged
merged 1 commit into from Oct 19, 2017

Conversation

Projects
None yet
6 participants
@martijnvg
Member

martijnvg commented Oct 12, 2017

Due to a change happened via #26102 to make the nested source consistent
with or without source filtering, the _source of a nested inner hit was
always wrapped in the parent path. This turned out to be not ideal for
users relying on the nested source, as it would require additional parsing
on the client side. This change fixes this, the _source of nested inner hits
is now no longer wrapped by parent json objects, irregardless of whether
the _source is included as is or source filtering is used.

Internally source filtering and highlighting relies on the fact that the
_source of nested inner hits are accessible by its full field path, so
in order to now break this, the conversion of the _source into its binary
form is performed in FetchSourceSubPhase, after any potential source filtering
is performed to make sure the structure of _source of the nested inner hit
is consistent irregardless if source filtering is performed.

PR for #26944

@colings86

I left a few comments

Show outdated Hide outdated ...in/java/org/elasticsearch/search/fetch/subphase/FetchSourceSubPhase.java Outdated
Show outdated Hide outdated ...in/java/org/elasticsearch/search/fetch/subphase/FetchSourceSubPhase.java Outdated
Show outdated Hide outdated ...in/java/org/elasticsearch/search/fetch/subphase/FetchSourceSubPhase.java Outdated
Show outdated Hide outdated ...in/java/org/elasticsearch/search/fetch/subphase/FetchSourceSubPhase.java Outdated
@tlrx

tlrx approved these changes Oct 19, 2017

LGTM, thanks for the changes

Return the _source of inner hit nested as is without wrapping it into…
… its full path context

Due to a change happened via #26102 to make the nested source consistent
with or without source filtering, the _source of a nested inner hit was
always wrapped in the parent path. This turned out to be not ideal for
users relying on the nested source, as it would require additional parsing
on the client side. This change fixes this, the _source of nested inner hits
is now no longer wrapped by parent json objects, irregardless of whether
the _source is included as is or source filtering is used.

Internally source filtering and highlighting relies on the fact that the
_source of nested inner hits are accessible by its full field path, so
in order to now break this, the conversion of the _source into its binary
form is performed in FetchSourceSubPhase, after any potential source filtering
is performed to make sure the structure of _source of the nested inner hit
is consistent irregardless if source filtering is performed.

PR for #26944

Closes #26944

@martijnvg martijnvg merged commit 87c9b79 into elastic:master Oct 19, 2017

1 of 2 checks passed

elasticsearch-ci Build started sha1 is merged.
Details
CLA Commit author is a member of Elasticsearch
Details

@lcawl lcawl added v6.0.0-rc2 and removed v6.0.0 labels Oct 30, 2017

@clintongormley clintongormley removed the v6.1.0 label Dec 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment