I have a scenario in which external agent generates ranking function dynamically which I want to pass as a query argument instead of statically defining it in search definition file, something like
http://localhost:8080/search/?query=honda car&rankfeature.rankingExpression="query(title_match_weight)*matches(title)+query(tags_match_weight)*matches(tags)"&rankfeature.query(title_match_weight)=10&rankfeature.query(tags_match_weight)=20
which I am not able to do now. Do we have solution to achieve this in Vespa?
I have tried foreach
in rank expression command to serve this purpose but it doesn't serve flexibility of having any function dynamically.
http://docs.vespa.ai/documentation/ranking.html#using-query-variables explains about macros and I find that macros is taken as rank-feature and rank feature can be passed in the query. So that should mean macro can be passed in the query which can be used in the expression, but it is not possible.