-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Add support for missing value fetchers. #63515
Conversation
7bb39be
to
98ebee3
Compare
Pinging @elastic/es-search (:Search/Search) |
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.
Makes sense to me.
When I was prototyping grok runtime fields I had a similar problem with throwing from valueFetcher
. I think maybe we should add some guidance that you should never throw from this.
I wonder if it'd make sense to have some kind of "there are no values in this field" kind of marker so that *
skips them. Not a "for now" problem - this seems perfect.
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.
I'm not sure that the implementation is correct for the text/search-as-you-type subfields? I may just be missing something though.
...s/mapper-extras/src/main/java/org/elasticsearch/index/mapper/SearchAsYouTypeFieldMapper.java
Show resolved
Hide resolved
...s/mapper-extras/src/main/java/org/elasticsearch/index/mapper/SearchAsYouTypeFieldMapper.java
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/mapper/TextFieldMapper.java
Show resolved
Hide resolved
This current implementation indeed works (and is tested through |
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.
I should really at least add a comment, at first glance it's unclear why this works!
That would be great, thanks. LGTM otherwise!
@nik9000 your
I guess an alternative approach would be to return no values instead of throwing. Right now, I'd prefer to keep the approach simple and return values for all registered fields. If we don't want to return values, then I think a better option is to avoid registering internal text fields at all -- I filed #63446 to discuss this idea. |
This PR implements value fetching for the following field types: * `text` phrase and prefix subfields * `search_as_you_type`, plus its subfields * `token_count`, which is implemented by fetching doc values Supporting these types helps ensure that retrieving all fields through `"fields": ["*"]` doesn't fail because of unsupported value fetchers.
This PR implements value fetching for the following field types:
text
phrase and prefix subfieldssearch_as_you_type
, plus its subfieldstoken_count
, which is implemented by fetching doc valuesSupporting these types helps ensure that retrieving all fields through
"fields": ["*"]
doesn't fail because of unsupported value fetchers.