You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Michael McCandless (JIRA)" <ji...@apache.org> on 2009/12/13 16:15:18 UTC
[jira] Commented: (LUCENE-2146) DisjunctionMaxQuery has incorrect
hashCode() implementation
[ https://issues.apache.org/jira/browse/LUCENE-2146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789899#action_12789899 ]
Michael McCandless commented on LUCENE-2146:
--------------------------------------------
By any chance do you also have a patch to fix this issue?
> DisjunctionMaxQuery has incorrect hashCode() implementation
> ------------------------------------------------------------
>
> Key: LUCENE-2146
> URL: https://issues.apache.org/jira/browse/LUCENE-2146
> Project: Lucene - Java
> Issue Type: Bug
> Components: Search
> Affects Versions: 2.9
> Reporter: wang
> Priority: Minor
> Fix For: 3.1
>
> Attachments: LUCENE-2146.patch
>
>
> The DisjunctionMaxQuery class hashCode() implementation is non-deterministic. It uses disjuncts.hashCode() in the computation.
> if the contents of disjuncts are arrays, just as DisjunctionMaxQueryTest.
> ArrayList list1 = new ArrayList();
> ArrayList list2 = new ArrayList();
> String[] terms ={"term1","term2"};
> String[] terms2 ={"term1","term2"};
> list1.add(terms);
> list2.add(terms2);
> DisjunctionMaxQuery query1 = new DisjunctionMaxQuery(list1,0.0f);
> DisjunctionMaxQuery query2 = new DisjunctionMaxQuery(list2,0.0f);
> according to the definition of DisjunctionMaxQuery, i think query1 and query2 should be equal.
> but DisjunctionMaxQueryTest failed. That is because of DisjunctionMaxQuery.hashCode(){disjuncts.hasCode()};
> maybe my thought is wrong.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org