Improved control of search scoring

Often I find myself wanting to control the factors that contribute to scoring results without resorting to complex boolean expressions.

Some examples:

  • 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

This is very interesting. Do you have any input on how this would look like in NoQL. A JavaScript API invocation example would be helpful.

Regards,
Morten

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 :slight_smile:

1 Like