[
https://issues.apache.org/jira/browse/SOLR-2762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13106088#comment-13106088
]
David Smiley commented on SOLR-2762:
------------------------------------
That TED 4am video was entertaining but weird. Normally I think of TED video as
educational / inspiring but that was a bit random.
I like your rename of "greedy" to "collectAll".
The code is definitely easier to read with a remove and then an add, even if it
internally does more work than my loop did. I actually considered that
approach but I know how performance-contious the developers here are so I
didn't do that. I hoped ArrayList had some sort of shift method but it
doesn't.
By the way, you forgot to copy the code improvement I put in my patch to your
existing logic that I told you about. At your comment: "// Insert as the first
result and truncate at num.", you did an add then a remove, when you should do
a remove then an add in order to avoid potentially needlessly expanding
ArrayList's internal array.
> 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
> Attachments: SOLR-2762.patch, SOLR-2762.patch,
> SOLR-2762_FSTLookup_off_by_one.patch, SOLR-2762_FSTLookup_off_by_one.patch
>
>
> 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]