-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
QueryStringQueryBuilder equals == true when query is not equal #29403
Labels
Comments
@jecstarinnovations This is indeed a bug. Thanks for reporting it. |
Pinging @elastic/es-search-aggs |
dnhatn
added
the
:Search/Search
Search-related issues that do not fall into other categories
label
Apr 5, 2018
@jecstarinnovations thanks for reporting this bug. I've raised #29406 which should fix this |
colings86
added a commit
that referenced
this issue
Apr 6, 2018
* Fixes query_string query equals timezone check This change fixes a bug where two `QueryStringQueryBuilder`s were found to be equal if they had the same timezone set even if the query string in the builders were different Closes #29403 * Adds mutate function to QueryStringQueryBuilderTests * iter
@jecstarinnovations thanks for raising this issue, I've merged a fix into the master branch and will back port to the 6.x branch shortly |
colings86
added a commit
that referenced
this issue
Apr 6, 2018
* Fixes query_string query equals timezone check This change fixes a bug where two `QueryStringQueryBuilder`s were found to be equal if they had the same timezone set even if the query string in the builders were different Closes #29403 * Adds mutate function to QueryStringQueryBuilderTests * iter server/src/main/java/org/elasticsearch/index/query/QueryStringQueryBuild er.java server/src/test/java/org/elasticsearch/index/query/QueryStringQueryBuild erTests.java test/framework/src/main/java/org/elasticsearch/test/AbstractQueryTestCas e.java server/src/main/java/org/elasticsearch/index/query/QueryStringQueryBuild er.java
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Elasticsearch version (
bin/elasticsearch --version
): 6.2.3Plugins installed: [] D.N.A.
JVM version (
java -version
): openjdk version "1.8.0_161"OS version (
uname -a
if on a Unix-like system): Linux jecstar-laptop 4.15.13-300.fc27.x86_64 #1 SMP Mon Mar 26 19:06:57 UTC 2018 x86_64 x86_64 x86_64 GNU/LinuxDescription of the problem including expected versus actual behavior: The doEquals() method in the org.elasticsearch.index.query.QueryStringQueryBuilder is not working properly. When two different instances with different queries are compared by the equals method everything works as expected (equals() == false).
When adding an equal timezone id to both instances of the QueryStringQueryBuilder, the equals() method will return true despite the query values are not equal. This is caused because parenthesis are missing around the statement at line 928.
Steps to reproduce:
For a complete example see the attached gradle project.
querystringquerybug.tar.gz
Provide logs (if relevant): D.N.A.
The text was updated successfully, but these errors were encountered: