-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Query refactoring: MatchQueryBuilder #13402
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: MatchQueryBuilder #13402
Conversation
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.
can we throw an IAE if either is null?
|
this looks great, I put some general comments where I thought it makes sense to be more strict and have less null vaules to signal not set. |
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.
nit: default constants could be made public?
|
I reviewed this too, looks good, only thing is as Simon said I would move to primitive types whenever possible on the builder, remove null checks and set proper defaults. |
0cbfaaa to
ea5d9b4
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.
in other queries we have Fuzziness.AUTO as default, doesn't it apply here too?
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.
But can you use this if you don't want any fuzzy query? Will check.
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.
I think AUTO is different from having no fuzziness defined, so I guess this doesn't work.
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.
weird, I thought this was very similar to query_string where we do have AUTO as default, but eventually it isn't, sorry.
|
left couple of tiny comments, LGTM though |
e055416 to
4574ee3
Compare
This add equals, hashcode, read/write methods, separates toQuery and JSON parsing and adds tests. Also moving MatchQueryBuilder.Type to MatchQuery to MatchQuery, adding serialization and hashcode, equals there. Relates to elastic#10217
4574ee3 to
90fac17
Compare
This PR separates toQuery and JSON parsing for MatchQueryBuilder and adds equals, hashcode, read/write methods. Also moving MatchQueryBuilder.Type to MatchQuery to MatchQuery, adding serialization and hashcode, equals there.
Relates to #10217