org.elasticsearch.index.mapper.MapperParsingException: Failed to parse
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:509)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:438)
at org.elasticsearch.index.shard.service.InternalIndexShard.prepareCreate(InternalIndexShard.java:287)
at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:210)
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:532)
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction$1.run(TransportShardReplicationOperationAction.java:430)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.elasticsearch.common.jackson.core.JsonParseException: Unexpected character ('O' (code 79)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: [B@5e7d093a; line: 4, column: 10]
at org.elasticsearch.common.jackson.core.JsonParser._constructError(JsonParser.java:1284)
at org.elasticsearch.common.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:588)
at org.elasticsearch.common.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:509)
at org.elasticsearch.common.jackson.core.json.UTF8StreamJsonParser._handleUnexpectedValue(UTF8StreamJsonParser.java:2094)
at org.elasticsearch.common.jackson.core.json.UTF8StreamJsonParser.nextToken(UTF8StreamJsonParser.java:561)
at org.elasticsearch.common.xcontent.json.JsonXContentParser.nextToken(JsonXContentParser.java:48)
at org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:461)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:494)
... 8 more
but of no avail. I am still getting the same error for inserting the above
mentioned document.
On Friday, December 21, 2012 12:11:04 PM UTC+5:30, Ivan Brusic wrote:
ObjectId and NumberLong are MongoDB concepts (IIRC). Simply map your
ObjectId as a string and NumberLong as a long.
The issue is not the mapping, but the document itself. Like I stated
before, ObjectId and NumberLong are MongoDB concepts. Those tags are not
standard JSON. The JSON parser will only accept standard JSON documents.
Not sure how you are integrating MongoDB with Elasticsearch. ObjectIds in
MongoDB contained specific information which is useless in Elasticsearch
(machine identifier, counter), so a pure String field would be a suitable
replacement. In fact, ids in ES should be strings.
NumberLong can just be a standard number field. I don't use JSON, but I
don't think JSON has number types. Anyone care to elaborate?
I am trying to index the documents in MognoDB using the mongo river. Were
you able to find any solution for this problem. Any help would be
appreciated.
Thanks,
Aditya
On Friday, December 21, 2012 6:58:39 AM UTC, Rahul Gupta wrote:
Do I need to change these fields in MongoDB itself or just changing the ES
mapping should work.
but of no avail. I am still getting the same error for inserting the above
mentioned document.
On Friday, December 21, 2012 12:11:04 PM UTC+5:30, Ivan Brusic wrote:
ObjectId and NumberLong are MongoDB concepts (IIRC). Simply map your
ObjectId as a string and NumberLong as a long.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.