Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chenhh021 opened this issue Dec 11, 2022 · 2 comments · May be fixed by #783
Open

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

chenhh021 opened this issue Dec 11, 2022 · 2 comments · May be fixed by #783

Comments

@chenhh021
Copy link
Contributor

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.

@jeme
Copy link
Contributor

jeme commented Dec 11, 2022

Most/all issues from the Lucene (Java) version that has been fixed later than v4.8 will obviously be in this v. of Lucene.NET as it targets that version (v4.8) - since that issue is marked as fixed in 9.0, it's a given that it affects Lucene.NET as is.

Not sure what the procedure for that is here.

@chenhh021
Copy link
Contributor Author

Anyway, I think a PR will act as a good reference for someone meet the same problem, so I'm working for one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants