[ https://issues.apache.org/jira/browse/LUCENE-9940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17335255#comment-17335255 ]
ASF subversion and git services commented on LUCENE-9940: --------------------------------------------------------- Commit f7a3587091f8ce05ef08a56523571239b383b217 in lucene's branch refs/heads/main from Alan Woodward [ https://gitbox.apache.org/repos/asf?p=lucene.git;h=f7a3587 ] LUCENE-9940: DisjunctionMaxQuery shouldn't depend on disjunct order for equals checks (#110) DisjunctionMaxQuery stores its disjuncts in a Query[], and uses Arrays.equals() for comparisons in its equals() implementation. This means that the order in which disjuncts are added to the query matters for equality checks. This commit changes DMQ to instead store its disjuncts in a Multiset, meaning that ordering no longer matters. The getDisjuncts() method now returns a Collection<Query> rather than a List, and some tests are changed to use query equality checks rather than iterating over disjuncts and expecting a particular order. > The order of disjuncts in DisjunctionMaxQuery affects equals() impl > ------------------------------------------------------------------- > > Key: LUCENE-9940 > URL: https://issues.apache.org/jira/browse/LUCENE-9940 > Project: Lucene - Core > Issue Type: Bug > Reporter: Alan Woodward > Assignee: Alan Woodward > Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > DisjunctionMaxQuery stores its disjuncts in a java array, and its equals() > implementation uses Arrays.equal() when checking equality. This means that > two queries with the same disjuncts but added in a different order will > compare as different, even though their results will be identical. We should > replace the array with a Set. -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org