Getting exception -org.elasticsearch.common.jackson.JsonParseException?


(Sam-4) #1

Hi

I try to use rabbitmq river for indexing.bulk message format is below:

{ "index" : { "_index" :idx_primaryfile, "_type" :primaryfile, "_id" :
3 }}
{ primaryfile :{"primaryfileID":3,"jobID":
115028,"StandardizationStatusid":
3,"AccountName":"intel","AccountNameClean":"intelclean"}}
{ "create" : { "_index" :idx_primaryfile, "_type" : primaryfile,
"_id" :3 }}
{ primaryfile :{"primaryfileID":3,"jobID":
115028,"StandardizationStatusid":
3,"AccountName":"intel","AccountNameClean":"intelclean"}}

i got the following exception:

org.elasticsearch.common.jackson.JsonParseException: Unexpected
character ('i' (code 105)): expected a valid value (number, String,
array, object, 'true', 'false' or 'null')
at [Source: [B@1fe8714; line: 1, column: 26]
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._handleUnexpectedValue(Utf8StreamParser.java:
1581)
at
org.elasticsearch.common.jackson.impl.Utf8StreamParser.nextToken(Utf8StreamParser.java:
385)
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:619)

please help me,where the problem.

Thanks


(Matt) #2

I don't have the mappings you do, but my guess is that the index and type
names should be strings. That is:

{ "index" : { "_index" :"idx_primaryfile", "_type" :"primaryfile", "_id" : 3
}}
...
...

Give that a try?


(Sam-4) #3

Thanks for reply.it work for me.

On Dec 9, 10:25 am, Matt matt....@gmail.com wrote:

I don't have the mappings you do, but my guess is that the index and type
names should be strings. That is:

{ "index" : { "_index" :"idx_primaryfile", "_type" :"primaryfile", "_id" : 3}}

...
...

Give that a try?


(system) #4