-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Simplify runtime fields factory function #71027
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
Simplify runtime fields factory function #71027
Conversation
We currently use a TriFunction that takes the field name, the script params and the search lookup and returns a LeafFactory. Name and script params never change though and are available when the function is created, so the tri function can become a function search lookup -> leaf factory which is much easier to reason about.
|
Pinging @elastic/es-search (Team:Search) |
| import org.elasticsearch.index.mapper.Mapper; | ||
| import org.elasticsearch.index.mapper.RuntimeField; | ||
| import org.elasticsearch.index.mapper.TextSearchInfo; | ||
| import org.elasticsearch.index.mapper.ValueFetcher; |
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.
this was a funny one, there were unused imports but checkstyle was not complaining? This comes from the recent package change I think.
romseygeek
left a comment
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.
Nice clean up, LGTM
|
run elasticsearch-ci/1 |
We currently use a TriFunction that takes the field name, the script params and the search lookup and returns a LeafFactory. Name and script params never change though and are available when the function is created, so the tri function can become a function search lookup -> leaf factory which is much easier to reason about.
We currently use a TriFunction that takes the field name, the script params and the search lookup and returns a LeafFactory. Name and script params never change though and are available when the function is created, so the tri function can become a function search lookup -> leaf factory which is much easier to reason about.
We currently use a TriFunction that takes the field name, the script params and the search lookup and returns a LeafFactory. Name and script params never change though and are available when the function is created, so the tri function can become a function search lookup -> leaf factory which is much easier to reason about.