Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3, 4.0-ALPHA
    • Fix Version/s: 3.5, 4.0-ALPHA
    • Component/s: modules/spellchecker
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      This is a spin-off from SOLR-2585.

      Currently o.a.l.s.s.SpellChecker and o.a.l.s.s.DirectSpellChecker support two "Suggest Modes":
      1. Suggest for terms that are not in the index.
      2. Suggest "more popular" terms.

      This issue is to add a third Suggest Mode:
      3. Suggest always.

      This will assist users in developing context-sensitive spell suggestions and/or did-you-mean suggestions. See SOLR-2585 for a full discussion.

      Note that o.a.l.s.s.SpellChecker already can support this functionality, if the user passes in a NULL term & IndexReader. This, however, is not intutive. o.a.l.s.s.DirectSpellChecker currently has no support for this third Suggest Mode.

      1. LUCENE-3436.patch
        23 kB
        James Dyer
      2. LUCENE-3436.patch
        22 kB
        James Dyer

        Issue Links

          Activity

          Hide
          James Dyer added a comment -
          • Creates a new Enum, "SuggestMode".
          • SpellChecker methods that used to take a boolean "morePopular" have been converted to use the new Enum.
          • Old SpellChecker methods have been marked as @Deprecated with comments (can be removed entirely for Trunk. Included here for possible 3.x inclusion)
          • A new Unit Test method for 0.a.l.s.s.SpellChecker tests "SUGGEST_MORE_POPULAR" and "SUGGEST_ALWAYS" (prior, "morePopular" had no test coverage).
          • A new Unit Test scenario added to TestDirectSpellChecker for testing "SUGGEST_ALWAYS".
          Show
          James Dyer added a comment - Creates a new Enum, "SuggestMode". SpellChecker methods that used to take a boolean "morePopular" have been converted to use the new Enum. Old SpellChecker methods have been marked as @Deprecated with comments (can be removed entirely for Trunk. Included here for possible 3.x inclusion) A new Unit Test method for 0.a.l.s.s.SpellChecker tests "SUGGEST_MORE_POPULAR" and "SUGGEST_ALWAYS" (prior, "morePopular" had no test coverage). A new Unit Test scenario added to TestDirectSpellChecker for testing "SUGGEST_ALWAYS".
          Hide
          Robert Muir added a comment -

          Hi James, thanks for this work!

          I agree, I think we should do this refactoring (and backport to 3.x so we can nuke the deprecations from trunk).

          only one thing, can we fix the indentation in the patch?
          In general we use 2 spaces (not tabs) and spaces after if keyword, etc

          so instead of:

          if(suggestMode==SuggestMode.SUGGEST_ALWAYS)
          	{
              		ir = null;
              		field = null;
              	}
          
          if (suggestMode == SuggestMode.SUGGEST_ALWAYS) {
            ir = null;
            field = null;
          }
          

          for some of the IDEs (I dont know what editor you use?) we have style configurations: there are some links to these configuration files
          located here: http://wiki.apache.org/lucene-java/HowToContribute

          Thanks again!

          Show
          Robert Muir added a comment - Hi James, thanks for this work! I agree, I think we should do this refactoring (and backport to 3.x so we can nuke the deprecations from trunk). only one thing, can we fix the indentation in the patch? In general we use 2 spaces (not tabs) and spaces after if keyword, etc so instead of: if(suggestMode==SuggestMode.SUGGEST_ALWAYS) { ir = null; field = null; } if (suggestMode == SuggestMode.SUGGEST_ALWAYS) { ir = null; field = null; } for some of the IDEs (I dont know what editor you use?) we have style configurations: there are some links to these configuration files located here: http://wiki.apache.org/lucene-java/HowToContribute Thanks again!
          Hide
          James Dyer added a comment -

          I downloaded Eclipse-lucene-codestyle.xml and re-formatted the lines I changed/added. Hopefully everything is to spec now.

          Show
          James Dyer added a comment - I downloaded Eclipse-lucene-codestyle.xml and re-formatted the lines I changed/added. Hopefully everything is to spec now.
          Hide
          Robert Muir added a comment -

          Thanks James!

          Show
          Robert Muir added a comment - Thanks James!
          Hide
          Uwe Schindler added a comment -

          Bulk close after release of 3.5

          Show
          Uwe Schindler added a comment - Bulk close after release of 3.5

            People

            • Assignee:
              Robert Muir
              Reporter:
              James Dyer
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development