Open lrynek opened 5 years ago
Pinging @elastic/es-search
@lrynek Thank you for filling the issue. Our current plan is to deprecate a function_score
query in favour of script_score
query. That's why we don't plan to introduce any enhancements to function_score
query including the one you proposed.
I will keep this issue open though, as it suggests an interesting idea for a new query type we are thinking -- a complex boolean query that can combine clauses' scores in multiple ways.
May not be completely relevant to your issue, but ES has a concept of named queries that may help your usecase.
@mayya-sharipova Thank you for the response and the tip about named queries - it is very useful 🙂. Looking forward to see the new ES compound query, please take into account this feature - it would be perfect to identify particular scoring values in the ES response! 🤞
@mayya-sharipova Hi! 👋 🙂 Any notice about this feature request? 🙏 Do you mind adding it in previous ES versions maybe (6.x as well)?
@mayya-sharipova any update on this - it would be awesome to have such a feature // maybe at least at 7.x version? // or it is better to do via a plugin? Thanks for any insight 😊
Pinging @elastic/es-search (Team:Search)
@mayya-sharipova maybe you can take advantage of the change made in OpenSearch (same concept applied as for _name
but for functions / as we discussed at some point about named queries):
https://github.com/opensearch-project/OpenSearch/issues/1711
Pinging @elastic/es-search-relevance (Team:Search Relevance)
When trying to extract current factor value from
_explanation
part of ElasticSearch JSON response (i.e. for debugging or logging purposes), I can do it only with text matching of a script body (and only with those functions that operates on script language, thefilter
ones are out of reach). I would add a new fieldkey
(or whatever name suits best) to thefunction_score
queryfunctions
array items, as follows:Now
(see: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html)
Request
Response
After implementation
Request
Response
The retrieval of specific computed values will be more precise after such or similar implementation.