1

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?

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.