[
https://issues.apache.org/jira/browse/LUCENE-2146?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
wang updated LUCENE-2146:
-------------------------
Attachment: (was: LUCENE-2146.patch)
> 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: [email protected]
For additional commands, e-mail: [email protected]