If we search for "Padma Priya" and is there any exact match then we need to show that result first but what happening is It's showing "Padma" posts first only because of keyword density and weightage.
If there is no "Padma Priya" then we want to show "Padma" results and "Priya" Results as per keyword density and weightage.
If we found both "Padma Priya" Keyword in Text and the URL then we need to give high priority to URL then Title after that page content.
This is my query:
{
searchBody = {
"from" : 0,
"size" : size,
"query": {
"bool": {
"should" : [
{
"match": {
"location": {
"query": q,
// "boost": 5
}
}
},
{
"match": {
"title": {
"query": q,
"boost": 5
}
}
}
,
{
"match": {
"description": {
"query": q
}
}
}
]
}
}
};
}