I need to find all documents in a MongoDB database that have a property containing a string that is similar to the search term but allows for a certain % in divergence.
In plain javascript I could for example use https://www.npmjs.com/package/string-similarity and then basically match all documents that have > 90% similarity score.
I'd like do to this as MongoDB query and be as performant as possible as the database contains millions of documents.
What possible options do I have in this situation?
- I found something about $text search, but it doesn't seem it helps a lot
- I was thinking about creating some sort of signature for each document, like some sort of hash that allows for some sort of divergence.
I am really happy for every idea to get this solved in the best possible way.