-
Notifications
You must be signed in to change notification settings - Fork 73
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
[BUG] NeuralQueryBuilder doEquals() and doHashCode() don't consider all the parameters that can impact the query result #1010
Comments
Looking into this issue. |
that's interesting finding, thanks fro reporting it. There is a |
Discussed with Martin offline that we don't know how those functions are used in core/plugin. But we should try to build them in a right behavior. So we propose to have parameters |
Also noticed that in HybridQueryBuilder the doEquals() and doHashCode() doesn't match so will also fix it as part of this one. The missing field in the doHashCode() is fieldName which is not being used anywhere. I think we should remove it. Would wait for Martin's input on this before taking the next step since it was added by him. |
What is the bug?
The doEquals() and doHashCode() methods in NeuralQueryBuilder fail to account for all parameters that influence query results. This oversight can lead to scenarios where two queries are mistakenly identified as equal, even though their outcomes differ.
How can one reproduce the bug?
Whenever two NeuralQueryBuilder instances have differing parameters that are not accounted for in the doEquals() and doHashCode() methods, these methods will incorrectly identify the instances as equal.
Below is the current implementation:
But it has more parameters.
What is the expected behavior?
doEquals() and doHashCode() methods should account for all the parameters that can impact the query result.
What is your host/environment?
N/A
Do you have any screenshots?
N/A
Do you have any additional context?
If these methods are used for OpenSearch caching, it could lead to incorrect results being returned when the difference between a new query and an old query lies solely in the parameters that are not considered. Further investigation is required to understand how these two functions are utilized within OpenSearch.
The text was updated successfully, but these errors were encountered: