Skip to content

The order of disjuncts in DisjunctionMaxQuery affects equals() #779

@chenhh021

Description

@chenhh021

See Lucene-9940. I find it valid for current Lucene.Net.

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.

Fix it may break current behavior, but in case someone need it, I will create a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions