In ElasicSearch ho creato un indice "test" e mappature come qui di seguitoCome risolvere MapperParsingException: mappatura oggetto per la [TEST] ha cercato di analizzare come oggetto, ma ha ottenuto EOF
{
"index": {
"_index": "test",
"_type": "test"
},
"settings": {
"index.number_of_replicas": 0,
"index.number_of_shards": 2
},
"mappings": {
"_default_": {
"date_detection": false
},
"test": {
"properties": {
"dateModified": {
"dynamic": "true",
"properties": {
"date": {
"type": "string"
},
"time": {
"type": "string"
}
}
}
}
}
}
}
Indice è stato creato con successo. Mi certa data come
{"index":{"_index":"test","_type":"test"}}
{"dateModified":{"date":"25/05/2015","time":"17:54 IST"}}
record inserito succesfully.If dò dati, come di sotto di essa dando errore
{"index":{"_index":"test","_type":"test"}}
{"dateModified":"25/05/2015"}
org.elasticsearch.index.mapper.MapperParsingException: object mapping for [test] tried to parse as object, but got EOF, has a concrete value been provided to it?
at org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:498)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:541)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:490)
at org.elasticsearch.index.shard.service.InternalIndexShard.prepareCreate(InternalIndexShard.java:392)
at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:193)
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:511)
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction$1.run(TransportShardReplicationOperationAction.java:419)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Allora come risolvere questo problema, ho letto alcuni blog e messaggi relativi a questo problema, ma non hanno dato soluzione a questo problema.
Sì, sembra che non è possibile memorizzare diversi tipi di valore in un singolo campo. La stessa cosa menzionata qui: http://blog.endpoint.com/2013/04/elasticsearch-object-mapping-eof-400.html – n0rm1e