Solr Fuzzy Search for similar words

陌路散爱 提交于 2019-12-02 18:25:29

No, you do not need to enable stemming, and the use of a stemmer may be causing the problem.

You have far too many filters on the text field. You are converting a word to a Porter stem, which often is not a real word, then taking the phonetic key of that. The surface word will rarely match the phonetic key stored in the index. The phonetic key will be very different from the original word.

Use the analyzer page in the admin UI to see how terms are processed.

I recommend splitting the kinds of approximate match into different fields.

  • text_exact: lowercase, that's about it
  • text_stem: lowercase and stem
  • text_phonetic: lowercase and double metaphone, do not stem

Use fuzzy matching with text_exact, because it handles typing errors. Do not use fuzzy against the other fields.

You can weight these fields differently, the exact match is a higher-quality match than the rest, so it can have a bigger weight. The stemmed match is a better match than phonetic, so it should have a weight smaller than exact, but bigger than phonetic.

In order to get Fuzzy Searches to work, you will need to enable the correct Stemming and/or Filter Factory for your desired language. Please see the Langauge Analysis topic on the Solr Wiki for more details.

Edit: Please see Analyzers, Tokenizers and Token Filters for more details on the different ways of indexing your data and how this impacts the search of your data.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!