Respect null_value parameter in the fields retrieval API.#58623
Merged
jtibshirani merged 1 commit intoelastic:field-retrievalfrom Jun 30, 2020
Merged
Respect null_value parameter in the fields retrieval API.#58623jtibshirani merged 1 commit intoelastic:field-retrievalfrom
jtibshirani merged 1 commit intoelastic:field-retrievalfrom
Conversation
Collaborator
|
Pinging @elastic/es-search (:Search/Mapping) |
Contributor
Author
|
I wasn't happy with how much complexity this added. It seems too inconsistent not to respect |
10 tasks
2a15f6c to
476e454
Compare
nik9000
approved these changes
Jun 30, 2020
Member
nik9000
left a comment
There was a problem hiding this comment.
I left a small question but I'm happy either way.
| return XContentMapValues.extractValue(pathElements, 0, map, null); | ||
| } | ||
|
|
||
| @SuppressWarnings({"unchecked"}) |
| /** | ||
| * A value to use in place of a {@code null} value in the document source. | ||
| */ | ||
| protected Object nullValue() { |
Member
There was a problem hiding this comment.
How bad would it be to make this abstract so implemeneters need to think about it?
Contributor
Author
There was a problem hiding this comment.
To me, null_value isn't a cross-cutting feature: only 9 out of ~40 field mappers implement it. In many cases it doesn't make that much sense (or could be harmful?), like setting a null_value for a geopoint. So I'm inclined to avoid making it abstract and encouraging mappers to implement it.
Contributor
Author
|
Thanks @nik9000 for reviewing ! |
jtibshirani
added a commit
that referenced
this pull request
Jun 30, 2020
…58623) This PR adds a version of `XContentMapValues.extractValue` that accepts a default value to return in place of 'null'. It then uses this method when looking up source values to return the configured `null_value` instead of 'null' when retrieving fields.
jtibshirani
added a commit
that referenced
this pull request
Jul 8, 2020
…58623) This PR adds a version of `XContentMapValues.extractValue` that accepts a default value to return in place of 'null'. It then uses this method when looking up source values to return the configured `null_value` instead of 'null' when retrieving fields.
jtibshirani
added a commit
that referenced
this pull request
Jul 14, 2020
…58623) This PR adds a version of `XContentMapValues.extractValue` that accepts a default value to return in place of 'null'. It then uses this method when looking up source values to return the configured `null_value` instead of 'null' when retrieving fields.
jtibshirani
added a commit
that referenced
this pull request
Jul 15, 2020
…58623) This PR adds a version of `XContentMapValues.extractValue` that accepts a default value to return in place of 'null'. It then uses this method when looking up source values to return the configured `null_value` instead of 'null' when retrieving fields.
jtibshirani
added a commit
that referenced
this pull request
Jul 18, 2020
…58623) This PR adds a version of `XContentMapValues.extractValue` that accepts a default value to return in place of 'null'. It then uses this method when looking up source values to return the configured `null_value` instead of 'null' when retrieving fields.
jtibshirani
added a commit
that referenced
this pull request
Jul 21, 2020
…58623) This PR adds a version of `XContentMapValues.extractValue` that accepts a default value to return in place of 'null'. It then uses this method when looking up source values to return the configured `null_value` instead of 'null' when retrieving fields.
jtibshirani
added a commit
that referenced
this pull request
Jul 23, 2020
…58623) This PR adds a version of `XContentMapValues.extractValue` that accepts a default value to return in place of 'null'. It then uses this method when looking up source values to return the configured `null_value` instead of 'null' when retrieving fields.
jtibshirani
added a commit
to jtibshirani/elasticsearch
that referenced
this pull request
Jul 27, 2020
…lastic#58623) This PR adds a version of `XContentMapValues.extractValue` that accepts a default value to return in place of 'null'. It then uses this method when looking up source values to return the configured `null_value` instead of 'null' when retrieving fields.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a version of
XContentMapValues.extractValuethat accepts adefault value to return in place of 'null'. It then uses this method when
looking up source values to return the configured
null_valueinstead of'null' when retrieving fields.