MongoDB fulltext search + workaround for partial word match

前端 未结 5 999
予麋鹿
予麋鹿 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:46

    You can not query for all the words in the index, but you can of course query the original document's fields. The words in the search index are also not always the full words, but are stemmed anyway. So you probably wouldn't find "blueberry" in the index, but just "blueberri".

提交回复
热议问题