-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Respect null_value parameter in the fields retrieval API. #58623
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -223,6 +223,13 @@ public CopyTo copyTo() { | |
return copyTo; | ||
} | ||
|
||
/** | ||
* A value to use in place of a {@code null} value in the document source. | ||
*/ | ||
protected Object nullValue() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How bad would it be to make this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To me, |
||
return null; | ||
} | ||
|
||
/** | ||
* Whether this mapper can handle an array value during document parsing. If true, | ||
* when an array is encountered during parsing, the document parser will pass the | ||
|
@@ -285,7 +292,7 @@ public void parse(ParseContext context) throws IOException { | |
* @return a list a standardized field values. | ||
*/ | ||
public List<?> lookupValues(SourceLookup lookup, @Nullable String format) { | ||
Object sourceValue = lookup.extractValue(name()); | ||
Object sourceValue = lookup.extractValue(name(), nullValue()); | ||
if (sourceValue == null) { | ||
return List.of(); | ||
} | ||
|
@@ -337,6 +344,7 @@ protected FieldMapper clone() { | |
} | ||
} | ||
|
||
|
||
@Override | ||
public final FieldMapper merge(Mapper mergeWith) { | ||
FieldMapper merged = clone(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍