Hi everyone,
I'm trying to use reciprocal ranking fusion (RRF) to combine the results of two query performed with the following code:
GET /books_index/_search
{
"query": {
"bool": {
"should": [
{
"match": {
"title": "the"
}
},
{
"match": {
"description": "in"
}
}
]
}
}
}
In practice what I need to do is returning a single list of document based on the new score obtained by computing the RRF of each document.
The new score of each document should be: 1/(document position in the result list of the query on title) + 1/(document position in the result list of the query on description).
Maybe it can be done with scripted_metric? But I do not know how.
I was also thinking on using aggregation, but I did not succeeded.