I have the following query :
{
"query":{
"bool":{
"should":[
{
"match_phrase":{
"related":"robotic"
}
},
{
"match_phrase":{
"related":"robotic arm"
}
},
{
"match_phrase":{
"related":"robot kit"
}
},
{
"match_phrase":{
"related":"robot technology"
}
},
{
"match_phrase":{
"related":"build a robot"
}
},
{
"match_phrase":{
"related":"robot for kids"
}
}
],
"minimum_should_match":"1"
}
}
}
I want to rank the results by number of matches. i.e. the result which matches all 6 should clauses should be on top while the one that matches only one should be somewhere near the bottom.
How do I do that?