November 22, 2017
Spell Check Search – Do you mean?
When users search, he/she may typo-mistake or spell wrong when entering keyword. You can check out Google search engine, it has a feature like below, asking “Did you mean: something else”, when searching with wrongly spell words like “knigs”.
With SOLR, you can also have this feature. Let’s update the C:/{your_installed_path}/solr-5.4.1/server/solr/films/conf/solrconfig.xml from <str name=”field”>text</str> to <str name=”field”>name</str> as:
After that, please restart the SOLR by “solr restart –p 8983”, and try the below example.
Requested URL | ||
Details | ||
By querying with above example, it will return you a list of suggestion like:
Please note that it is using spell request handler. |
||
Parameters | Values | Details |
q | knigs | Spell check text |
spellcheck | true | Turn on spell check |
spellcheck.collate | true | Turn on spell check collate |
spellcheck.build | true | Turn on spell check build |