Lucene - Core
  1. Lucene - Core
  2. LUCENE-3341

Spellcheker is not checking word with less than 3 characters

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Not A Problem
    • Affects Version/s: 3.2
    • Fix Version/s: 3.2
    • Component/s: modules/spellchecker
    • Labels:
      None
    • Environment:

      Window XP, Java 6, JBoss 4.2.3GA

    • Lucene Fields:
      New

      Description

      Problem: SpellChecker is not checking spelling of a word less than 3 characters. i.e "en", "am", "an", etc. So these words are getting misspelled in result.

      Cause:
      org.apache.lucene.search.spell.SpellChecker class is not adding in index dictionary a word which has less than 3 characters.

      The method indexDictionary() in SpellChecker class is ignoring all the characters less than 3 characters length and not adding them in index dictionary.

      Example code:
      SpellChecker luceneSpellChecker = null;

      luceneSpellChecker = new SpellChecker(new RAMDirectory(), new NGramDistance());
      luceneSpellChecker.indexDictionary(
      new PlainTextDictionary( new InputStreamReader(dictionaryFile, "UTF-8")),
      10, 500, false);
      System.out.println("Word 'an' exist? "+luceneSpellChecker.exist("an");
      System.out.println("Word 'am' exist? "+luceneSpellChecker.exist("am");

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        1592d 8h 48m 1 James Dyer 04/Dec/15 20:19
        James Dyer made changes -
        Field Original Value New Value
        Resolution Not A Problem [ 8 ]
        Status Open [ 1 ] Closed [ 6 ]
        Hide
        James Dyer added a comment -

        We can do what the user wants, using DirectSolrSpellChecker and setting the "minQueryLength" parameter.

        Show
        James Dyer added a comment - We can do what the user wants, using DirectSolrSpellChecker and setting the "minQueryLength" parameter.
        Devang Panchal created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Devang Panchal
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1h
              1h
              Remaining:
              Remaining Estimate - 1h
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development