7

I have a requirement to implement google-like 'Did you mean?' functionalities. If user make a mistake in typing then I've to show 'Did you mean [correct search term]'.

What is the best way in sitecore to implement this?

3

2 Answers 2

2

We can achieve this using spellcheck dictionary.

  • Create a composite tokenized index field using custom n-gram analyzer with help of ShingleFilter.
  • Create a custom spellcheck dictionary.
  • Get suggested words from the dictionary.

For achieving this in Sitecore using Lucene, download the available source code for "Sitecore Cookbook for Developers" from -

https://github.com/PacktPublishing/Sitecore-Cookbook-For-Developers/tree/master/Chapter%209/7.%20Correcting%20a%20search%20with%20did%20you%20mean

0

It sounds like you need the SpellChecker package. There are versions of this module for both Lucene and Solr, as well as .NET ports for Lucene.Net (which is what Sitecore uses). Make sure you get the version of the plugin appropriate for the version of Lucene / Solr you are using.

Remember that when dealing with Lucene or Solr, there exists a large community of developers across both Java and Windows platforms. Most search related questions are not particular to Sitecore.

For example, see: https://stackoverflow.com/questions/348093/did-you-mean-feature-in-lucene-net

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.