Skip to content

Conversation

@cbuescher
Copy link
Member

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

Copy link
Contributor

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?

@s1monw
Copy link
Contributor

s1monw commented Sep 8, 2015

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.

Copy link
Member

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?

@javanna
Copy link
Member

javanna commented Sep 9, 2015

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.

@cbuescher cbuescher force-pushed the feature/query-refactoring-match branch 2 times, most recently from 0cbfaaa to ea5d9b4 Compare September 9, 2015 13:34
@cbuescher
Copy link
Member Author

@s1monw @javanna I changed the optional values in the builder to defaults where possible, could you have another look?

Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Member

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.

@javanna
Copy link
Member

javanna commented Sep 9, 2015

left couple of tiny comments, LGTM though

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
@cbuescher cbuescher force-pushed the feature/query-refactoring-match branch from 4574ee3 to 90fac17 Compare September 10, 2015 10:15
@cbuescher cbuescher merged commit 90fac17 into elastic:feature/query-refactoring Sep 10, 2015
@cbuescher cbuescher deleted the feature/query-refactoring-match branch March 11, 2016 11:50
@clintongormley clintongormley added :Search/Search Search-related issues that do not fall into other categories and removed :Query Refactoring labels Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Search/Search Search-related issues that do not fall into other categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants