Skip to content
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

ContextSuggester: Adding couple of tests to catch more bugs #5596

Merged

Conversation

spinscale
Copy link
Contributor

A bunch of minor fixes have been included here, especially due
to wrongly parsed mappings. Also using assertions resulted in an
NPE because they were disabled in the distribution.

Closes #5525

Also, there is one last thing, which needs discussing: Currently the default precision is so accurate, that a suggestions will fail, you index the lat/lon 52.363389/4.888695 but search with 52.3633, 4.8886 - I think this is confusing. We should either force people to set a precision in the mapping or have less high accuracy.

@@ -96,7 +97,9 @@ public PrefixTokenFilter(TokenStream input, char separator, Iterable<? extends C
this.prefixes = prefixes;
this.currentPrefix = null;
this.separator = separator;
assert (prefixes != null && prefixes.iterator().hasNext()) : "one or more prefix needed";
if (prefixes == null || !prefixes.iterator().hasNext()) {
throw new ElasticsearchException("one or more prefixes needed");
Copy link
Contributor

Choose a reason for hiding this comment

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

can this be ElasticsearchIllegalArguementExcpetion?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@s1monw
Copy link
Contributor

s1monw commented Mar 31, 2014

I think this one looks good though I left two small comments

@s1monw
Copy link
Contributor

s1monw commented Mar 31, 2014

LGTM

A bunch of minor fixes have been included here, especially due
to wrongly parsed mappings. Also using assertions resulted in an
NPE because they were disabled in the distribution.

Closes elastic#5525
@spinscale spinscale merged commit 0ff30ad into elastic:master Mar 31, 2014
@clintongormley clintongormley added >bug v2.0.0-beta1 v1.2.0 :Search/Suggesters "Did you mean" and suggestions as you type labels Jun 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search/Suggesters "Did you mean" and suggestions as you type v1.2.0 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Context Suggester Issues/Exceptions
3 participants