Skip to content

Conversation

alexksikes
Copy link
Contributor

Relates to #10217

This PR is against the query-refactoring branch.


WildcardQuery query = new WildcardQuery(new Term(indexFieldName, valueBytes));
QueryParsers.setRewriteMethod(query, rewrite);
query.setRewriteMethod(QueryParsers.parseRewriteMethod(rewrite));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we set the rewrite method twice it seems? probably a bug in the original parser

@javanna
Copy link
Member

javanna commented Jul 11, 2015

left a few comments, looks good though

@alexksikes alexksikes force-pushed the feature/query-refactoring-wildcard branch from 8024840 to 18842d3 Compare July 13, 2015 16:14
@alexksikes
Copy link
Contributor Author

@javanna Thanks for the review. I rebased and addressed all comments.

if (Strings.isEmpty(this.fieldName)) {
validationException = addValidationError("field name cannot be null or empty.", validationException);
}
if (this.value == null) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to check for empty string here as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not something we systematically do. The parser did not do this check, hence the reason why it is not in validate.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be interesting then to test what happens when you provide an empty string? is it something that we should accept or should we add validation for it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did we test this? what happens with empty string? is it something that we should allow or maybe change and disallow?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parser did allow for it. It does return a valid query.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the question is if that query makes sense, does it return documents? which ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it returns an empty result set.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok lets leave it, it doesn't seem like a problem for now

@MaineC
Copy link

MaineC commented Jul 14, 2015

Left one question, looks good otherwise.

@alexksikes
Copy link
Contributor Author

@MaineC Thanks for the quick review. Should I just go ahead and push this?

/**
* Helper method to return a random rewrite method
*/
protected static String getRandomRewriteMethod() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was added with the prefix query already right? we need to rebase maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes of course

@javanna
Copy link
Member

javanna commented Jul 24, 2015

LGTM besides the two minor comments I left

Relates to elastic#10217
Closes elastic#12110

This PR is against the query-refactoring branch.
@alexksikes alexksikes force-pushed the feature/query-refactoring-wildcard branch from 64cdeaa to 94d13c7 Compare July 24, 2015 12:52
@alexksikes alexksikes merged commit 94d13c7 into elastic:feature/query-refactoring Jul 24, 2015
@alexksikes alexksikes deleted the feature/query-refactoring-wildcard branch July 24, 2015 12:55
mute pushed a commit to mute/elasticsearch that referenced this pull request Jul 29, 2015
Relates to elastic#10217
Closes elastic#12110

This PR is against the query-refactoring branch.
@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