Often I find myself wanting to control the factors that contribute to scoring results without resorting to complex boolean expressions.
- documents of type X should score better than documents of type Y that should score higher than documents of type Z
- new documents should score higher that old documents
- document with a value in a specific field should score higher, e.g “important=true”
Also discussed in Search boosting - again
Any input on this @runarM
I think there is a need to start supporting the a query-expresion as a json object, the same way as filters and aggregations work. The issue is how to keep backward compatibility with the existing “query” field which is a EnonicQL-expression. This is nice for some scenarios, but very soon get complex creating controllers since you have to translate stuff into strings that is very error-prone. With this is place it really a matter of mimic more or less the es-api, https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html
An alternative is to express this as a new separate field in the query-api, e.g function_score, but in the longer term I think the way to go is to rework the original query-api.
Luckily, its easy in XP to create a completely reworked query-lib
Thanks for the input. We have added this to our backlog.