MongoDB fulltext search + workaround for partial word match

前端 未结 5 996
予麋鹿
予麋鹿 2021-02-05 03:51

Since it is not possible to find \"blueberry\" by the word \"blue\" by using a mongodb full text search, I want to help my users to complete the word \"blue\" to \"blueberry\".

5条回答
  •  无人及你
    2021-02-05 04:42

    For those who have not yet started implementing any database architecture and are here for a solution, go for Elasticsearch. Its a json document driven database similar to mongodb structurally. It has "edge-ngram" analyzer which is really really efficient and quick in giving you did you mean for mis-spelled searches. You can also search partially.

提交回复
热议问题