-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Query refactoring: query_string query #13284
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
Query refactoring: query_string query #13284
Conversation
|
This PR contains a little breakage for the java api, as the It also moves to parsing the locale using |
83319cc to
a219114
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these boolean option be boolean rather than Boolean and define a default? or does null mean something for these values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only few stayed Boolean, I moved everything I could to primitive type. Exceptions are analyzeWildcard and allowLeadingWildcard. null there has a meaning (see toQuery method), as the value needs to be taken from the context, which we have only in toQuery, so we can't use it as a default value instead...
|
@javanna I left a few comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use isEmpty()?
|
I added some comments |
a219114 to
5f32534
Compare
|
I have addressed some comments, replied to others, also added a TODO on unifying settings and query options for later on. It should be ready. |
|
LGTM |
|
Merged 484fcd4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I'm a big fan of this. We should at least discuss it further?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a java api change only, you can always specify fields as "field1^5 field2^3" on the rest layer, but when using the java api you now have to do .field("field1", 5).field("field2", 3) instead of being able to do .field("field1^5").field("field2", 3) which makes no sense from a java point of view. There is a better method that accepts two arguments, which is the way to go. I don't think we need to keep the old method that requires us to parse a string to get out the actual field name and the boost value as part of the java api builder, that's something that should happen only as part of query parsing. I think this clarifies the change and addresses your concerns.
Fix for MatchQueryBuilderTests.testToQuery random fuzziness generation caused test failure. Relates to #13284
Refactoring of the query_string query: adds serialization bits, validate, equals, hashcode and tests for QueryStringQueryBuilder. Lucene query generation moved to toQuery method. Used QueryParserSettings as intermediate object, created on the data node, to provide arguments to MapperQueryParser for the lucene query parsing.
Relates to #10217