$ curl -XGET 'http://localhost:9200/_search' -d '{
"query" : {
"term" : { "user" : "kimchy" }
}
'
public class MyRestFilterDoingSpecialThings extends RestFilter {
...
Override
public void process(RestRequest request, RestChannel channel,
RestFilterChain filterChain) { ...
XContentType xContentType =
XContentFactory.xContentType(request.content()); //json
XContentParser parser =
XContentFactory.xContent(xContentType).createParser(request.content());
XContentParser.Token t = parser.nextToken();
//t is START_OBJECT
XContentBuilder builder =
XContentFactory.contentBuilder( xContentType).copyCurrentStructure(parser);
<-- fails with
org.elasticsearch.common.jackson.core.JsonParseException: Unexpected
end-of-input: expected close marker for OBJECT (from [Source: [B@29569b73;
line: 1, column: 0])
at [Source: [B@29569b73; line: 5, column: 64]
at
org.elasticsearch.common.jackson.core.JsonParser._constructError(JsonParser.java:1369)
at
org.elasticsearch.common.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:532)
at
org.elasticsearch.common.jackson.core.base.ParserMinimalBase._reportInvalidEOF(ParserMinimalBase.java:465)
at
org.elasticsearch.common.jackson.core.base.ParserBase._handleEOF(ParserBase.java:491)
at
org.elasticsearch.common.jackson.core.json.UTF8StreamJsonParser._skipWSOrEnd(UTF8StreamJsonParser.java:2513)
at
org.elasticsearch.common.jackson.core.json.UTF8StreamJsonParser.nextToken(UTF8StreamJsonParser.java:617)
at
org.elasticsearch.common.jackson.core.base.GeneratorBase.copyCurrentStructure(GeneratorBase.java:401)
at
org.elasticsearch.common.xcontent.json.JsonXContentGenerator.copyCurrentStructure(JsonXContentGenerator.java:310)
at
org.elasticsearch.common.xcontent.XContentBuilder.copyCurrentStructure(XContentBuilder.java:1035)
What did i wrong?
Thanks
Hendrik
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.