I have a data set like below
"hits": [
{
"_index": "demotest",
"_type": "demotest",
"_id": "2",
"_score": 1,
"_source": {
"name": "Duvvuri ram gopal reddy"
}
},
{
"_index": "demotest",
"_type": "demotest",
"_id": "1",
"_score": 1,
"_source": {
"name": "ram gopal reddy"
}
},
{
"_index": "demotest",
"_type": "demotest",
"_id": "3",
"_score": 1,
"_source": {
"name": "reddy ram gopal"
}
}
]
When i try to perform a match query with value as ram gopal reddy exact matched record is not showing on top. Query:
GET demotest/_search
{
"query": {
"match": {
"name": "ram gopal reddy"
}
}
}
Result after execution of above query:
"hits": [
{
"_index": "demotest",
"_type": "demotest",
"_id": "2",
"_score": 0.8630463,
"_source": {
"name": "Duvvuri ram gopal reddy"
}
},
{
"_index": "demotest",
"_type": "demotest",
"_id": "1",
"_score": 0.7594807,
"_source": {
"name": "ram gopal reddy"
}
},
{
"_index": "demotest",
"_type": "demotest",
"_id": "3",
"_score": 0.7594807,
"_source": {
"name": "reddy ram gopal"
}
}
]
How to get exact matched record on top in search results. Thanks