# Fuzzy matching algorithms

**URL:** <https://forum.weaviate.io/t/fuzzy-matching-algorithms/9603>\
**Category:** Support\
**Created:** [January 7, 2025, 9:21am UTC](https://forum.weaviate.io/t/fuzzy-matching-algorithms/9603 "2025-01-07T09:21:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rjalex](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/rjalex/32/807_2.png) [@rjalex](https://forum.weaviate.io/u/rjalex)\
**Post date:** [January 7, 2025, 9:21am UTC](https://forum.weaviate.io/t/fuzzy-matching-algorithms/9603/1 "2025-01-07T09:21:30Z")

</div>

In my application I need to apply apply fuzzy search on a text field to find matches even if the string was mis-typed. Imagine an application that needs to filter objects on a “surname” field and especially with foreign names the exact match could not work. Cosine nearness on embeddings would not help either in this case.

In my application I use this python library [RapidFuzz · PyPI](https://pypi.org/project/RapidFuzz/) which is very very good.

Would there be any mechanism to apply an external function such as this to a text field in a collection without having to applicatively iterate through all the collection?

Thanks

---

<div class="post-metadata">

**Author:** ![Dirk](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dirk/32/46_2.png) [@Dirk](https://forum.weaviate.io/u/Dirk)\
**Post date:** [January 7, 2025, 1:14pm UTC](https://forum.weaviate.io/t/fuzzy-matching-algorithms/9603/2 "2025-01-07T13:14:29Z")

</div>

I don’t think we have anything directly like this but the following could work:

- use named vectors
- define a named vector with the vectorizer `text2vec-bigram` that takes your surname field as input. This is more of a test vectorizer and not documented but I think it could work for your usecase. You can check the code here: [weaviate/modules/text2vec-bigram/bigram.go at main · weaviate/weaviate · GitHub](https://github.com/weaviate/weaviate/blob/main/modules/text2vec-bigram/bigram.go)
- Those vectors should be very close when there is just a typo in the name and most of it is the same

Note that this module is probably not enabled in weaviate cloud

---

<div class="post-metadata">

**Author:** ![rjalex](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/rjalex/32/807_2.png) [@rjalex](https://forum.weaviate.io/u/rjalex)\
**Post date:** [January 7, 2025, 2:19pm UTC](https://forum.weaviate.io/t/fuzzy-matching-algorithms/9603/3 "2025-01-07T14:19:44Z")

</div>

Very interesting Dirk, thanks.

I will definitely experiment.

But actually my example was very simplistic. The true task is quite tough with searching through a long list of wordplays.

These wordplays are obtained though techniques such as splitting or fusing a legal word, making deliberate typos etc, therefore the various algorithms of the rapidfuzz library give me more latitude.

---

<div class="post-metadata">

**Author:** ![Dirk](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dirk/32/46_2.png) [@Dirk](https://forum.weaviate.io/u/Dirk)\
**Post date:** [January 8, 2025, 7:00am UTC](https://forum.weaviate.io/t/fuzzy-matching-algorithms/9603/4 "2025-01-08T07:00:51Z")

</div>

> The true task is quite tough with searching through a long list of wordplays.

Sadly don’t have a better idea ☹  
The mentioned vectorizer has a few options so maybe play around and see if any of them works. Please let me know if something comes out of this!
