Reputation: 149
I have a problem I'm not quite sure how to solve in elasticsearch.
I have a bunch of documents that have an array of names in them
{
...
"names":["name nameson", "example exampleson"],
...
}
And I want to have a search query where I only have a name as an input. For example "name testson".
If the array contains at least one name that is above 80% similar to the input name(according to some algoritm), then it should be returned by the query.
Is this possible in elasticsearch?
Upvotes: 1
Views: 836
Reputation: 431
If you want at least one name, you can defined the field in the mapping as "text" and the search will find it.
If you want to return percent of similarity, may be the vector field will help you.
Another way is using fuzzy search, but this will give the number of error letters, instead of percent of similarity.
I think, that the easiest way - define the "text" field and use fuzzy search.
Upvotes: 1