I want to get results in a specific order first get the exact phrase (match_phrase) match and then match any word in phrase (match), for example, if I'm searching for "where can i find my account"I will get the documents containing the full phrase "where can I find my account" first and then documents that contain one or more of the words "where", "can", "find", "my", "account"
my query :
GET my_index/_search
{
"query": {
"bool": {
"should": [
{
"match": {"body": "right usage of Localization" }
} ,
{
"match": {"title": "right usage of Localization" }
}
],
"should": [
{
"match_phrase": {"body": "translated" }
},
{
"match_phrase": {"title": "translated" }
}
]
}
} }