You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2017/09/13 01:24:00 UTC
[jira] [Updated] (LUCENE-7968) AnalyzingSuggester's comparator
compares incorrectly
[ https://issues.apache.org/jira/browse/LUCENE-7968?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Muir updated LUCENE-7968:
--------------------------------
Attachment: LUCENE-7968.patch
Patch, including a test that fails even without the assert. It just adds 50 surface forms with the same weight that all analyze to the same string, and asserts that lookup() returns them back in sorted order by surface form.
When payloads=false, the BytesRef's length should be the {{remaining}} bytes, not negative.
> AnalyzingSuggester's comparator compares incorrectly
> ----------------------------------------------------
>
> Key: LUCENE-7968
> URL: https://issues.apache.org/jira/browse/LUCENE-7968
> Project: Lucene - Core
> Issue Type: Bug
> Reporter: Robert Muir
> Attachments: LUCENE-7968.patch
>
>
> Found by LUCENE-7966, but we should fix here separate.
> Currently the tie-break case of this comparator is buggy when {{hasPayloads=false}}, as it assigns *negative* lengths to the BytesRefs being compared. The current BytesRef.compareTo simply silently returns false in this case, hiding the bug.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org