How to use the Rank Features Query to explicitly sort some products

I'm trying to explicitly put some documents on the top of some query results. After searching a while, apparently the most suitable tool to achieve it is using the rank features datatype. Although i didn't figured out how to make it explicit. For example :

PUT my_index/_doc/1 
{ 
    "topics": {
        "politics" : 1,
        "economics" : 2
   }
}

PUT my_index/_doc/2
{ 
    "topics": {
        "politics" : 2,
        "economics" : 1
    }
}

With those documents, when the query is "politics" i'd like to make the doc1 the first result and the doc2 the second, independently of their score. And when the query is "economics", the doc2 would be the first and the doc1 the second.

Is it possible to achieve this with the rank features datatype ? If not, what would be your recommendation ?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.