Add support for missing value fetchers.#63515
Conversation
7bb39be to
98ebee3
Compare
|
Pinging @elastic/es-search (:Search/Search) |
nik9000
left a comment
There was a problem hiding this comment.
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.
romseygeek
left a comment
There was a problem hiding this comment.
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 |
romseygeek
left a comment
There was a problem hiding this comment.
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:
textphrase 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.