-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
Allow reusing the same scripts in sorts, aggregations and script queries #48059
Comments
Pinging @elastic/es-search (:Search/Search) |
@jpountz This is not very clear to me. For example if we have a script Do you have ideas how a potential API of this |
@mayya-sharipova I think there are many options, we'd need to weigh pros and cons, e.g.
There might be other options I haven't thought of. |
I wonder if we can reuse already existing script_fields parameter in the query phase as well. {
"query": {
"range": {
"price_in_usd": {
"lte": 100
}
}
},
"script_fields": {
"price_in_usd": {
"script": {
"source": "doc['price'].value * 1.25"
}
}
}
} |
I like the idea. |
We are going to introduce support for runtime fields. The first implementation of them is going to be scripted runtime fields, which will address exactly the limitations mentioned in this issue, hence I am closing this in favour of #59332 . |
Scripted queries and aggs provide a lot a flexibility. One downside however is that they require different kinds of scripts. It makes it challenging for Kibana to expose scripted fields.
Instead of expecting scripts of
script
queries to return a boolean, could we accept arbitrary search scripts and allow users to pass an expected value as well? This way the same scripts could be used in both queries and aggregations.The text was updated successfully, but these errors were encountered: