Solr
  1. Solr
  2. SOLR-2576

DirectSolrSpellChecker is not returning frequency information

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 4.0-ALPHA
    • Fix Version/s: 3.3, 4.0-ALPHA
    • Component/s: spellchecker
    • Labels:
      None

      Description

      DirectSolrSpellChecker is not returning frequency information. This also causes the "correctlySpelled" flag in extended results to sometimes be wrong.

        Activity

        Hide
        James Dyer added a comment -

        This patch fixes DirectSolrSpellChecker to correctly forward the frequency data. Results are now consistent with IndexBasedSpellChecker. An additional DSSC unit test is also added.

        I also changed the method name "SpellingResult.add(Token token, int docFreq)" to "SpellingResult.addFrequency(Token token, int docFreq)" . This less-ambiguous method name should help prevent this kind of error in the future. Note, however, if back-porting to 3.x, it might be wise to add back a deprecated "SpellingResult.add(Token token, int docFreq)" method. This will prevent us from breaking anyone's custom solr spellcheckers...

        Show
        James Dyer added a comment - This patch fixes DirectSolrSpellChecker to correctly forward the frequency data. Results are now consistent with IndexBasedSpellChecker. An additional DSSC unit test is also added. I also changed the method name "SpellingResult.add(Token token, int docFreq)" to "SpellingResult.addFrequency(Token token, int docFreq)" . This less-ambiguous method name should help prevent this kind of error in the future. Note, however, if back-porting to 3.x, it might be wise to add back a deprecated "SpellingResult.add(Token token, int docFreq)" method. This will prevent us from breaking anyone's custom solr spellcheckers...
        Hide
        Robert Muir added a comment -

        Thanks James, patch looks good!

        This is definitely the source of confusion, because there are several overloaded methods
        named add(), one of which does a completely different thing

        Show
        Robert Muir added a comment - Thanks James, patch looks good! This is definitely the source of confusion, because there are several overloaded methods named add(), one of which does a completely different thing
        Hide
        Robert Muir added a comment -

        adding fix version 3.3 to backport the API improvement.

        Show
        Robert Muir added a comment - adding fix version 3.3 to backport the API improvement.
        Hide
        Robert Muir added a comment -

        Committed revision 1133187 (trunk), 1133190 (branch_3x)

        Show
        Robert Muir added a comment - Committed revision 1133187 (trunk), 1133190 (branch_3x)
        Hide
        Robert Muir added a comment -

        Bulk close for 3.3

        Show
        Robert Muir added a comment - Bulk close for 3.3

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development