$ curl -XPOST localhost:9200/toto/toto -d '@file.json'
{"error":"MapperParsingException[failed to parse
[model.moduleScores.module.smart_typed_number_ponderation]]; nested:
JsonParseException[Current token (END_OBJECT) not numeric, can not use
numeric value accessors\n at [Source: [B@10c042ab; line: 1, column:
29238]]; ","status":400}
The column 29238 correspond to } in the following sentence :
..."smart_typed_number_ponderation":100}],...
Clearly Jackson is surprised to see }, it wants a number.
just for information, we found the orgin of error.
in the same object being indexed (a very large object) there was
a smart_typed_number_ponderation field already in the same scope (inside an
array of objects). That field contains a null value. it seems that hence ES
has mapped this field as an object and it dosn't like to see a number
instead.
Le jeudi 11 juillet 2013 18:36:22 UTC+2, Filirom1 a écrit :
Hello everyone,
I am trying to send a JSON to Elasticsearch but it fails with a strange
Jackson error :
$ curl -XPOST localhost:9200/toto/toto -d '@file.json'
{"error":"MapperParsingException[failed to parse
[model.moduleScores.module.smart_typed_number_ponderation]]; nested:
JsonParseException[Current token (END_OBJECT) not numeric, can not use
numeric value accessors\n at [Source: [B@10c042ab; line: 1, column:
29238]]; ","status":400}
The column 29238 correspond to } in the following sentence :
..."smart_typed_number_ponderation":100}],...
Clearly Jackson is surprised to see }, it wants a number.
You are describing the reason for always creating a mapping for each index,
each document type within the index, and each field within each document
type. If you don't do this, Elasticsearch guesses. And it does not always
have enough information to guess correctly. For example, some of my
applications hold a phone number and we want them to be stored as strings
and not long integers (for several reasons).
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.