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

ElasticClient.Analyze throws exception when done with an empty text #962

Closed
Roemer opened this issue Sep 23, 2014 · 1 comment
Closed

ElasticClient.Analyze throws exception when done with an empty text #962

Roemer opened this issue Sep 23, 2014 · 1 comment

Comments

@Roemer
Copy link

Roemer commented Sep 23, 2014

Calling Analyze with en empty / null value throws an Exception. I think it would be better to be able to send empty analyze requests and get an IAnalyzeResponse back with the IsValid = false and appropriate error message set instead of the exception.

Example:

var req = new AnalyzeRequest(String.Empty);
req.Indices = new IndexNameMarker[] { IndexName };
req.Field = field;
// Next line throws an exception
var analyzeResult = Client.Analyze(req);
@gmarz gmarz closed this as completed in b4fba2d Sep 23, 2014
@gmarz
Copy link
Contributor

gmarz commented Sep 23, 2014

@Roemer agreed, it doesn't really make sense to call Analyze on an empty string, but nonetheless, we should treat it as we normally do with elasticsearch exceptions. Just pushed the above fix, thanks for reporting this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants