vespa-engine / vespa

AI + Data, online. https://vespa.ai
https://vespa.ai
Apache License 2.0
5.79k stars 604 forks source link

Allow specifying rank feature configuration using query rank properties #31211

Open mohsin36 opened 5 months ago

mohsin36 commented 5 months ago

Describe the bug We want to set custom 'averageFieldLength' via ranking.properties but it doesn't seem to be working.

To Reproduce

Pass bm25(data).averageFieldLength via query API params

http://container:8080/search/?ranking.properties.bm25(data).averageFieldLength=2000&ranking.profile=test-profile&query=contract&yql=select title,data from schema-xyz where userQuery() limit 50

rank-profile test-profile {
      first-phase {
          expression: bm25(data) + bm25(title)
      }
       match-features {
          bm25(title)
          bm25(data)
        }
}

Expected behavior Expect to see change in relevance score. It seems the bm25(data).averageFieldLength=2000 via Query API is not passed to internal bm25 feature correctly

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Vespa version Vespa 8.270.8

Additional context Add any other context about the problem here.

bratseth commented 5 months ago

This isn't supported - you can only set it in a rank profile. If you want to try different values you need to create multiple rank profiles (that all inherit all other values) and choose between them in the query.

Let's convert this to a feature request.