JsonParseException[Current token (END_OBJECT) not numeric, can not use numeric value accessors

Hello everyone,

I am trying to send a JSON to ElasticSearch but it fails with a strange
Jackson error :

$ curl -s -L -o file.json

https://gist.github.com/Filirom1/666228afa43bcf46c3d4/raw/ce4352f1ec2a7b1af606907da44bc2bd55db7df6/file.json

$ 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.

The JSON is valid, I have tested it on

I use the latest ES version

$ curl -s localhost:9200 |json version.number
0.90.2

Cheers
Romain

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

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 -s -L -o file.json 

https://gist.github.com/Filirom1/666228afa43bcf46c3d4/raw/ce4352f1ec2a7b1af606907da44bc2bd55db7df6/file.json

$ 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.

The JSON is valid, I have tested it on
http://jsonformatter.curiousconcept.com/

I use the latest ES version

$ curl -s localhost:9200 |json version.number
0.90.2

Cheers
Romain

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi!

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).

Of course, Elasticsearch Platform — Find real-time answers at scale | Elastic is a good
place to start.

Brian

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.