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

Prevent illegal max_query_terms values in MLT query #49927

Closed
cbuescher opened this issue Dec 6, 2019 · 1 comment
Closed

Prevent illegal max_query_terms values in MLT query #49927

cbuescher opened this issue Dec 6, 2019 · 1 comment
Labels
>enhancement good first issue low hanging fruit :Search/Search Search-related issues that do not fall into other categories v7.6.0 v8.0.0-alpha1

Comments

@cbuescher
Copy link
Member

The MoreLikeThisQueryBuilder and MoreLikeThisQuery can be created with illegal max_query_terms values (e.g. negativ or 0 values). This can lead to NPEs as demonstrated in #48007. We should check and reject those values in the relevant places (e.g. setters) in the builder and the query.

@cbuescher cbuescher added >enhancement good first issue low hanging fruit :Search/Search Search-related issues that do not fall into other categories v8.0.0 v7.6.0 labels Dec 6, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Search)

cbuescher pushed a commit that referenced this issue Dec 9, 2019
…sQuery (#49966)

Adds validation for maxQueryTerms to be greater than 0 for MoreLikeThisQuery 
and MoreLikeThisQueryBuilder.

Closes #49927
SivagurunathanV pushed a commit to SivagurunathanV/elasticsearch that referenced this issue Jan 23, 2020
…sQuery (elastic#49966)

Adds validation for maxQueryTerms to be greater than 0 for MoreLikeThisQuery 
and MoreLikeThisQueryBuilder.

Closes elastic#49927
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement good first issue low hanging fruit :Search/Search Search-related issues that do not fall into other categories v7.6.0 v8.0.0-alpha1
Projects
None yet
Development

No branches or pull requests

3 participants