[ 
https://issues.apache.org/jira/browse/SOLR-2762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13105291#comment-13105291
 ] 

Dawid Weiss commented on SOLR-2762:
-----------------------------------

The relevant snippet for the scenario you described (exactMatchFirst, 
onlyMorePopular, input match is exactly represented in the suggestions list) is 
here:
{code}

        if (collect(res, num, weight, output, arc) && greedy) {
          // We have enough suggestions to return immediately. Keep on looking 
for an
          // exact match, if requested.
          if (exactMatchFirst) {
            Float exactMatchWeight = getExactMatchStartingFromRootArc(i, key);
            if (exactMatchWeight != null) {
              res.add(0, new LookupResult(key, exactMatchWeight));
              while (res.size() > num) {
                res.remove(res.size() - 1);
              }
            }
          }
          break;
        }
{code}
the only place where elements are removed from the suggestion list is in the 
while loop... but the condition is correct so I've no idea.

> FSTLookup returns one less suggestion than it should when onlyMorePopular=true
> ------------------------------------------------------------------------------
>
>                 Key: SOLR-2762
>                 URL: https://issues.apache.org/jira/browse/SOLR-2762
>             Project: Solr
>          Issue Type: Bug
>          Components: spellchecker
>    Affects Versions: 3.3
>            Reporter: David Smiley
>            Assignee: Dawid Weiss
>            Priority: Minor
>
> I'm using the Suggester.  When I switched from TSTLookup to FSTLookup, I 
> noticed that it returned one fewer suggestion than what I asked for. I have 
> spellcheck.onlyMorePopular=true; when I set it to false, I see the correct 
> count. Another aspect of the bug is that this off-by-one bug only seems to 
> occur when my suggestion has an exact match.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to