[ https://issues.apache.org/jira/browse/LUCENE-2146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12790107#action_12790107 ]
wang commented on LUCENE-2146: ------------------------------ Thanks Michael and Uwe. i understand it is not a bug. > 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: DisjunctionMaxQueryTest.java, 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-unsubscr...@lucene.apache.org For additional commands, e-mail: java-dev-h...@lucene.apache.org