[
https://issues.apache.org/jira/browse/LUCENE-5790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14045395#comment-14045395
]
Yonik Seeley commented on LUCENE-5790:
--------------------------------------
Yep... this code is incorrect:
{code}
MutableValueDouble b = (MutableValueDouble)other;
int c = Double.compare(value, b.value);
if (c != 0) return c;
if (!exists) return -1;
if (!b.exists) return 1;
return 0;
{code}
It should be:
{code}
MutableValueDouble b = (MutableValueDouble)other;
int c = Double.compare(value, b.value);
if (c != 0) return c;
if (exists == b.exists) return 0;
return exists ? 1 : -1;
{code}
I'm surprised the random grouping code didn't catch this. Perhaps the test
didn't use any missing values?
> MutableValue compareTo impls seem to be broken for exists==false
> ----------------------------------------------------------------
>
> Key: LUCENE-5790
> URL: https://issues.apache.org/jira/browse/LUCENE-5790
> Project: Lucene - Core
> Issue Type: Bug
> Reporter: Hoss Man
> Attachments: LUCENE-5790.patch
>
>
> On the solr-user mailing list, Ebisawa & Alex both commented that they've
> noticed bugs in the grouping code when some documents don't have values in
> the grouping field.
> In Ebisawa's case, he tracked this down to what appears to be some bugs in
> the logic of the "compareSameType" method of some of the MutableValue
> implementations.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]