did you mean lucene search spellchecker Jahia 7.3 Jahia 8

Jahia Search - How to configure "did you mean" feature?

Question

I have a default configuration for Apache Lucene search and I want to use the feature "did you mean" in my Jahia search, but it doesn't seem to be working.

How can I return search results with the "did you mean" feature?

Answer

To use this feature, you must properly configure the spell checker in Apache Lucene.  You must define which property of your nodes will be checked against the spell checker.

To do so, please follow these simple steps:

  • Edit the file digital-factory-data/repository/indexing_configuration.xml and add the following setting for spelling check. With this setting, the property jcr:title will be checked against the spell checker:
    <spellchecker>
        <include-property>jcr:title</include-property>
        <include-property>synonyms</include-property>
    </spellchecker>
  • Restart Jahia
  • Go to Search Engine Management on <server>/modules/tools/search.jsp and run the option "Spell checker index update".
  • Test the search again