I have data in elasticsearch, with field fullName
:
- John Doe Doe
- John Doe
- Eric John Doe
When I do a match query against fullName
, with this query
{
"from": 0,
"size": 20,
"query": {
"bool": {
"must": [
{
"match": {
"fullName": {
"query": "John Doe",
"operator": "AND",
"fuzziness": "AUTO"
}
}
}
]
}
}
}
I expect to get John Doe
(exact match) as first result.
Instead, the returned value is in this sequence:
- John Doe Doe
- Eric John Doe
- John Doe
Where the exact match is on the lowest result.
What should I do to put the exact match into first result?
I cannot use term
query since I still need a fuzzy match on fullName
Thanks