bob dabelina
bob dabelina

Reputation: 537

Solr spellcheck vs fuzzy search

I don't quite understand the difference between apache solr's spell check vs fuzzy search functionality.

I understand that fuzzy search matches your search term with the indexed value based on some difference expressed in distance.

I also understand that spellcheck also give you suggestions based on how close your search term is to a value in the index.

So to me those two things are not that different though I am sure that this is due to my shortcoming in understanding each feature thoroughly.

If anyone could provide an explanation preferably via an example, I would greatly appreciate it.

Thanks, Bob

Upvotes: 4

Views: 1180

Answers (1)

Pavel Artanov
Pavel Artanov

Reputation: 469

I'm not a professional in the Solr but I try to explain.

  1. Fuzzy search is a simple instruction for Solr to use a kind of spellchecking during requests - Solr’s standard query parser supports the fuzzy search and you can use this one without any additional settings, for example: roam~ or roam~1. And this so-colled spellcheking is used a Damerau-Levenshtein Distance or Edit Distance algorithm.
  2. To use spellchecking you need to configure it in the solrconfig.xml (please, see here). It gives you sort of flexibility how to implement spellcheking (there are a couple of OOTB implementation) so, for example, you can use another index for spellcheck thereby you decrease load on main index. Also for spellchecking you use another URL: /spell so it is not a search query like fuzzy query.

Why should I use spellcheking or fuzzy search? I guess it is depended on your server loading because the fuzzy search is more expensive and not recommended by the Solr team.

P.S. It is my understanding of fuzzy and spellcheking so if somebody has more correct and clear explanation, please, give us advice how to deal with them.

Upvotes: 2

Related Questions