mongodb approximate string matching

前端 未结 2 1225
谎友^
谎友^ 2021-01-31 10:06

I am trying to implement a search engine for my recipes-website using mongo db. I am trying to display the search suggestions in type-ahead widget box to the users.

I a

2条回答
  •  盖世英雄少女心
    2021-01-31 10:24

    The best case for it would be using elasticsearch fuzzy query: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-fuzzy-query.html

    It supports levenshtein distance algorithm out of the box and has additional features which can be useful for your requirements i.e.: - more like this - powerful facets / aggregations - autocomplete

提交回复
热议问题