Skip to content
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

Implement fields fetch for runtime fields (backport of #61995) #62416

Merged
merged 5 commits into from
Sep 16, 2020

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Sep 15, 2020

This implements the fields API in _search for runtime fields using
doc values. Most of that implementation is stolen from the
docvalue_fields fetch sub-phase, just moved into the same API that the
fields API uses. At this point the docvalue_fields fetch phase looks
like a special case of the fields API.

While I was at it I moved the "which doc values sub-implementation
should I use for fetching?" question from a bunch of instanceofs to a
method on LeafFieldData so we can be much more flexible with what is
returned and we're not forced to extend certain classes just to make the
fetch phase happy.

Relates to #59332

This implements the `fields` API in `_search` for runtime fields using
doc values. Most of that implementation is stolen from the
`docvalue_fields` fetch sub-phase, just moved into the same API that the
`fields` API uses. At this point the `docvalue_fields` fetch phase looks
like a special case of the `fields` API.

While I was at it I moved the "which doc values sub-implementation
should I use for fetching?" question from a bunch of `instanceof`s to a
method on `LeafFieldData` so we can be much more flexible with what is
returned and we're not forced to extend certain classes just to make the
fetch phase happy.

Relates to elastic#59332
@nik9000
Copy link
Member Author

nik9000 commented Sep 15, 2020

run elasticsearch-ci/default-distro

In elastic#61995 I moved the `docvalue_field` fetch code into a place where I
could share it with the fancy new `fields` fetch API. Specifically,
runtime fields can use it all that doc values code now. But I broke
`scaled_floats` by switching them how they are fetched from `double` to
`string`. This adds the override you need to switch them back.
@nik9000 nik9000 merged commit 24a24d0 into elastic:7.x Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant