I'm trying to implement a relevance feedback feature on my program using one of the available algorithms. This requires changing the original query score by adding it with the total of all relevant document's scores. The query with improved score should give new results when used. The problem is, so far I haven't found any way to change the query score on Lucene. Did I miss something on the documentation? Does Lucene provide a way to change an existing query's score?
To modify a query's score you wrap that query inside another query. There are several options for doing that in Lucene. Two very relevant ones:
DoubleValuesSource
that produces a boost per each document in the original set.FunctionScoreQuery
above. Check the docs for more info.