Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Bala Gudibandla 12 posts 131 karma points
    Jul 05, 2017 @ 21:23
    Bala Gudibandla

    Search: Has anyone implemented SpellChecker functionality using Lucene's API and Examine?

    Looking for expert's help to implement 'Did you mean' functionality/ display search term recommendations to the user. I'd like to use the index files, that were already created by Examine on the application startup, to apply SpellChecker algorithm.

    Example Usage from official documentation:

    SpellChecker spellchecker = new SpellChecker(spellIndexDirectory);
    // To index a field of a user index:
    spellchecker.indexDictionary(new LuceneDictionary(my_lucene_reader, a_field));
    // To index a file containing words:
    spellchecker.indexDictionary(new PlainTextDictionary(new File("myfile.txt")));
    String[] suggestions = spellchecker.suggestSimilar("misspelt", 5);

    I've no idea about spellIndexDirectory, my_lucene_reader


    Umbraco 7

    Lucene 2.9

    Lucene.Net.Contrib.SpellChecker assembly


  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Jul 06, 2017 @ 15:25
    Ismail Mayat


    Check out excellent post by Lars on how to do this

    Bascially you need to build a spell checker index of your current index then you can hit that todo the spellcheck.

  • Bala Gudibandla 12 posts 131 karma points
    Jul 06, 2017 @ 20:33
    Bala Gudibandla

    Thank you Ismail..! It worked :-)

  • Michaela Ivanova 12 posts 104 karma points
    Feb 20, 2018 @ 08:28
    Michaela Ivanova

    Hey, do you know how to fix: TypeLoadException: Could not load type 'Assembly.SpellingIndexer' from assembly 'Assembly'.

  • Bala Gudibandla 12 posts 131 karma points
    Feb 20, 2018 @ 15:11
    Bala Gudibandla

    You need to add the assembly Lucene.Net.Contrib.Analyzers to your project and configure it in ExamineSettings.config like below:

    <add name="SpellCheckIndexer" type="Our.Umbraco.ezSearch.SpellCheckIndexer, C_Umbraco"
                     analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"/>

    Note: SpellCheckIndexer is a custom indexer class I created in C_Umbraco.dll.

  • YESU RAJA CHINTA 22 posts 89 karma points
    Oct 12, 2022 @ 18:09

    Hey Bala How are you? My Umbraoc version is 7+, and I'm using Lucene 2.9. When I install the Lucene.Net.Contrib.SpellChecker assembly, I see a number of dll issues in the umbraco version. Can you tell me how to fix this problem?

    Would you kindly assist me?

Please Sign in or register to post replies

Write your reply to: