# JsonParseException\[Current token (END\_OBJECT) not numeric, can not use numeric value accessors

**URL:** <https://discuss.elastic.co/t/jsonparseexception-current-token-end-object-not-numeric-can-not-use-numeric-value-accessors/12760>\
**Category:** Elasticsearch\
**Created:** [July 11, 2013, 4:36pm UTC](https://discuss.elastic.co/t/jsonparseexception-current-token-end-object-not-numeric-can-not-use-numeric-value-accessors/12760 "2013-07-11T16:36:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Filirom1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/filirom1/32/2234_2.png) [@Filirom1](https://discuss.elastic.co/u/Filirom1)\
**Post date:** [July 11, 2013, 4:36pm UTC](https://discuss.elastic.co/t/jsonparseexception-current-token-end-object-not-numeric-can-not-use-numeric-value-accessors/12760/1 "2013-07-11T16:36:22Z")

</div>

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](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

> **[JSON Formatter & Validator](https://jsonformatter.curiousconcept.com/)**
>
> Format and validate JSON data so that it can easily be read by human beings.

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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Virgile\_Devaux\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/virgile_devaux_2/32/2139_2.png) [@Virgile\_Devaux\_2](https://discuss.elastic.co/u/Virgile_Devaux_2)\
**Post date:** [August 27, 2013, 1:32pm UTC](https://discuss.elastic.co/t/jsonparseexception-current-token-end-object-not-numeric-can-not-use-numeric-value-accessors/12760/2 "2013-08-27T13:32:55Z")

</div>

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](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/](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![brian\_yoder](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@brian\_yoder](https://discuss.elastic.co/u/brian_yoder)\
**Post date:** [August 27, 2013, 2:48pm UTC](https://discuss.elastic.co/t/jsonparseexception-current-token-end-object-not-numeric-can-not-use-numeric-value-accessors/12760/3 "2013-08-27T14:48:41Z")

</div>

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](http://www.elasticsearch.org/guide/reference/mapping/) 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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:19am UTC](https://discuss.elastic.co/t/jsonparseexception-current-token-end-object-not-numeric-can-not-use-numeric-value-accessors/12760/4 "2017-07-06T02:19:32Z")

</div>


