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

JsonGenerationException thrown in SuggestResponse#toString method #3661

Closed
javanna opened this Issue Sep 10, 2013 · 0 comments

Comments

Projects
None yet
1 participant
@javanna
Copy link
Member

commented Sep 10, 2013

The following exception is consistently thrown (and caught) by the SuggestResponse#toString method:

com.fasterxml.jackson.core.JsonGenerationException: Can not write a field name, expecting a value
    at com.fasterxml.jackson.core.base.GeneratorBase._reportError(GeneratorBase.java:444)
    at com.fasterxml.jackson.core.json.UTF8JsonGenerator.writeFieldName(UTF8JsonGenerator.java:167)
    at org.elasticsearch.common.xcontent.json.JsonXContentGenerator.writeFieldName(JsonXContentGenerator.java:74)
    at org.elasticsearch.common.xcontent.XContentBuilder.field(XContentBuilder.java:265)
    at org.elasticsearch.common.xcontent.XContentBuilder.startArray(XContentBuilder.java:210)
    at org.elasticsearch.search.suggest.Suggest$Suggestion.toXContent(Suggest.java:317)
    at org.elasticsearch.search.suggest.Suggest.toXContent(Suggest.java:148)
    at org.elasticsearch.action.suggest.SuggestResponse.toString(SuggestResponse.java:74)
    at java.lang.String.valueOf(String.java:2854)
    at java.io.PrintStream.println(PrintStream.java:821)

There seems to be a missing startObject/endObject. Even though it is not a blocking problem, it would be nice to be able to print out the string representation of a suggest response when needed.

@ghost ghost assigned javanna Sep 10, 2013

javanna added a commit to javanna/elasticsearch that referenced this issue Sep 10, 2013

Rewrote SuggestResponse#toString method
It only prints out json now (as the SearchResponse does)
Added missing startObject & endObject (was causing JsonGenerationException)

Closes elastic#3661

@javanna javanna closed this in 0b79ba9 Sep 10, 2013

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

Rewrote SuggestResponse#toString method
It only prints out json now (as the SearchResponse does)
Added missing startObject & endObject (was causing JsonGenerationException)

Closes elastic#3661
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.