Reputation: 15817
In elastic search index i have trademark data.I have trademarks named HILTON
in database, but when i search hillytown
its not finding hilton
, but when searched hilytown
it finds. How can i modify elsatic search to find hilton
when i search hillytown
note: : hillytown
has two l
The search that i tried is
$param = '
{
"query": {
"fuzzy" : {
"trademark" : {
"value": "'.$keyword.'",
"boost": 1.0,
"fuzziness": "AUTO",
"prefix_length": 0,
"max_expansions": 100,
"transpositions":true
}
}
}
}';
in
http://localhost:9200/watch_index_write/_search
Upvotes: 0
Views: 607
Reputation: 1691
I don't think you can get "hillytown" to match "hilton". Elasticsearch allows a maximum fuzziness (levenshtein distance) of 2, but hillytown has a distance of 3 (need to remove 3 letters).
I haven't tried it myself, but the phonetic analysis plugin might provide a way forward.
Upvotes: 1