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

Remove token_filter in _analyze API #20285

Merged

Conversation

johtani
Copy link
Contributor

@johtani johtani commented Sep 1, 2016

Remove the param and change docs

Closes #20283

Remove the param and change docs

Closes elastic#20283
@johtani johtani added review :Search/Analysis How text is split into tokens v5.0.0-beta1 labels Sep 1, 2016
try {
RestAnalyzeAction.buildFromContent(content, analyzeRequest, new ParseFieldMatcher(Settings.EMPTY));
} catch (Exception e) {
assertThat(e, instanceOf(IllegalArgumentException.class));
Copy link
Member

Choose a reason for hiding this comment

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

Maybe:

Exception e = expectThrows(IllegalArgumentException.class, () -> RestAnalyzeAction.buildFromContent(content, analyzeRequest, new ParseFieldMatcher(Settings.EMPTY)));
assertThat(e.getMessage(), startsWith("Unknown parameter [token_filter]"));

That way you don't have to assert the type of the exception.

@nik9000
Copy link
Member

nik9000 commented Sep 1, 2016

I left some wording suggestions but otherwise LGTM.

Fix wording in docs
Refactoring RestAnalyzeActionTests using expectThrows()

Closes elastic#20283
@johtani johtani force-pushed the fix/remove_token_filter_param_in_analyze_api branch from 70f0009 to aef2e5d Compare September 2, 2016 06:08
@johtani
Copy link
Contributor Author

johtani commented Sep 2, 2016

@nik9000 Thanks for reviewing. Updated docs and refactoring tests using expectThrows

@johtani johtani merged commit c4759bc into elastic:master Sep 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants