Getting org.elasticsearch.common.jackson.JsonParseException?


(Sam-4) #1

Hi

I am using following bulk message format for creating index using
rabbitmq river.

{"index" : { "_index" : "test", "_type" : "type1", "_id" : "1"
"_analyzer"="myanalyzer" } }
{ "type1" : { "field1" : "abc" } }
{ "myanalyzer" : {"type" : "custom", "tokenizer" :
"standard","filter" : {"asciifolding","stop":{"stopwords":
{"stop1","stop2"}},"length":{"min":"0","max":"2000"},"snowball",
"standard", "lowercase"}}}
{"create" : { "_index" : "test", "_type" : "type1", "_id" : "1" } }
{ "type1" : { "field1" : "abc" } }

Here i'm try to override the default analyzer with my custom
analyzer,but i got the following exception:

org.elasticsearch.common.jackson.JsonParseException: Unexpected
character ('"' (code 34)): was expecting comma to separate OBJECT
entries
at [Source: [B@157f3a4; line: 1, column: 65]
at
org.elasticsearch.common.jackson.JsonParser._constructError(JsonParser.java:
1291)
at
org.elasticsearch.common.jackson.impl.JsonParserMinimalBase._reportError(JsonParserMinimalBase.java:
385)
at
org.elasticsearch.common.jackson.impl.JsonParserMinimalBase._reportUnexpectedChar(JsonParserMinimalBase.java:
306)
at
org.elasticsearch.common.jackson.impl.Utf8StreamParser.nextToken(Utf8StreamParser.java:
312)
at
org.elasticsearch.common.xcontent.json.JsonXContentParser.nextToken(JsonXContentParser.java:
46)
at org.elasticsearch.action.bulk.BulkRequest.add(BulkRequest.java:
121)
at
org.elasticsearch.client.action.bulk.BulkRequestBuilder.add(BulkRequestBuilder.java:
84)
at org.elasticsearch.river.rabbitmq.RabbitmqRiver
$Consumer.run(RabbitmqRiver.java:216)
at java.lang.Thread.run(Thread.java:662)

please help me and point out where the problem and what will be the
correct mapping for override the default analyzer.

Thanks


(Shay Banon) #2

Can't help you since you past teh bulk message in the mail, and it looses
formatting which is important, gist it.

On Fri, Jan 6, 2012 at 8:59 AM, sam mishra.sameek@gmail.com wrote:

Hi

I am using following bulk message format for creating index using
rabbitmq river.

{"index" : { "_index" : "test", "_type" : "type1", "_id" : "1"
"_analyzer"="myanalyzer" } }
{ "type1" : { "field1" : "abc" } }
{ "myanalyzer" : {"type" : "custom", "tokenizer" :
"standard","filter" : {"asciifolding","stop":{"stopwords":
{"stop1","stop2"}},"length":{"min":"0","max":"2000"},"snowball",
"standard", "lowercase"}}}
{"create" : { "_index" : "test", "_type" : "type1", "_id" : "1" } }
{ "type1" : { "field1" : "abc" } }

Here i'm try to override the default analyzer with my custom
analyzer,but i got the following exception:

org.elasticsearch.common.jackson.JsonParseException: Unexpected
character ('"' (code 34)): was expecting comma to separate OBJECT
entries
at [Source: [B@157f3a4; line: 1, column: 65]
at

org.elasticsearch.common.jackson.JsonParser._constructError(JsonParser.java:
1291)
at

org.elasticsearch.common.jackson.impl.JsonParserMinimalBase._reportError(JsonParserMinimalBase.java:
385)
at

org.elasticsearch.common.jackson.impl.JsonParserMinimalBase._reportUnexpectedChar(JsonParserMinimalBase.java:
306)
at

org.elasticsearch.common.jackson.impl.Utf8StreamParser.nextToken(Utf8StreamParser.java:
312)
at

org.elasticsearch.common.xcontent.json.JsonXContentParser.nextToken(JsonXContentParser.java:
46)
at org.elasticsearch.action.bulk.BulkRequest.add(BulkRequest.java:
121)
at

org.elasticsearch.client.action.bulk.BulkRequestBuilder.add(BulkRequestBuilder.java:
84)
at org.elasticsearch.river.rabbitmq.RabbitmqRiver
$Consumer.run(RabbitmqRiver.java:216)
at java.lang.Thread.run(Thread.java:662)

please help me and point out where the problem and what will be the
correct mapping for override the default analyzer.

Thanks


(system) #3