# Number format exception for a string

**URL:** <https://discuss.elastic.co/t/number-format-exception-for-a-string/23602>\
**Category:** Elasticsearch\
**Created:** [May 11, 2015, 4:52am UTC](https://discuss.elastic.co/t/number-format-exception-for-a-string/23602 "2015-05-11T04:52:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bvnagaraju](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@bvnagaraju](https://discuss.elastic.co/u/bvnagaraju)\
**Post date:** [May 11, 2015, 4:52am UTC](https://discuss.elastic.co/t/number-format-exception-for-a-string/23602/1 "2015-05-11T04:52:44Z")

</div>

hi ,

am getting the below error in the response while doing bulk indexes and  
defined the field as string using put mapping

error=NumberFormatException[For input string: "two"]

can some one help me why am getting this error

Bulk Index Request:

{ "index" : {"\_type":"document","\_id":"1"} }  
{"customFields":{"numSort11":"1","numSort21":24866,"numSort31":11074,"numSort41":24866,"author2":"two","author3":"four  
five","author4":"six  
seven","dateSort21":"2015-05-12T04:47:08.5439655Z","dateSort31":"2015-05-10T04:47:08.5439655Z","doubleSort11":18.0,"doubleSort21":67884.18,"doubleSort31":54262.600000000006,"author1":54262.600000000006},"id":"1","rank":0.0,"dcn":"DCN1"}  
{ "index" : {"\_type":"document","\_id":"2"} }  
{"customFields":{"numSort11":"2","numSort21":24866,"numSort31":11074,"numSort41":24866,"author2":"two","author3":"four  
five","author4":"six  
seven","dateSort21":"2015-05-12T04:47:08.6338127Z","dateSort31":"2015-05-10T04:47:08.6338127Z","doubleSort11":18.0,"doubleSort21":67884.18,"doubleSort31":54262.600000000006,"author1":54262.600000000006},"id":"2","rank":0.0,"dcn":"DCN2"}  
{ "index" : {"\_type":"document","\_id":"3"} }  
{"customFields":{"numSort11":"3","numSort21":24866,"numSort31":11074,"numSort41":24866,"author2":"two","author3":"four  
five","author4":"six  
seven","dateSort21":"2015-05-12T04:47:08.7334259Z","dateSort31":"2015-05-10T04:47:08.7334259Z","doubleSort11":18.0,"doubleSort21":67884.18,"doubleSort31":54262.600000000006,"author1":54262.600000000006},"id":"3","rank":0.0,"dcn":"DCN3"}  
{ "index" : {"\_type":"document","\_id":"4"} }  
{"customFields":{"numSort11":"4","numSort21":24866,"numSort31":11074,"numSort41":24866,"author2":"two","author3":"four  
five","author4":"six  
seven","dateSort21":"2015-05-12T04:47:08.8252263Z","dateSort31":"2015-05-10T04:47:08.8252263Z","doubleSort11":18.0,"doubleSort21":67884.18,"doubleSort31":54262.600000000006,"author1":54262.600000000006},"id":"4","rank":0.0,"dcn":"DCN4"}  
{ "index" : {"\_type":"document","\_id":"5"} }  
{"customFields":{"numSort11":"5","numSort21":24866,"numSort31":11074,"numSort41":24866,"author2":"two","author3":"four  
five","author4":"six  
seven","dateSort21":"2015-05-12T04:47:08.9160501Z","dateSort31":"2015-05-10T04:47:08.9160501Z","doubleSort11":18.0,"doubleSort21":67884.18,"doubleSort31":54262.600000000006,"author1":54262.600000000006},"id":"5","rank":0.0,"dcn":"DCN5"}  
{ "index" : {"\_type":"document","\_id":"6"} }  
{"customFields":{"numSort11":"6","numSort21":24866,"numSort31":11074,"numSort41":24866,"author2":"two","author3":"four  
five","author4":"six  
seven","dateSort21":"2015-05-12T04:47:09.0058973Z","dateSort31":"2015-05-10T04:47:09.0058973Z","doubleSort11":18.0,"doubleSort21":67884.18,"doubleSort31":54262.600000000006,"author1":54262.600000000006},"id":"6","rank":0.0,"dcn":"DCN6"}  
{ "index" : {"\_type":"document","\_id":"7"} }  
{"customFields":{"numSort11":"7","numSort21":24866,"numSort31":11074,"numSort41":24866,"author2":"two","author3":"four  
five","author4":"six  
seven","dateSort21":"2015-05-12T04:47:09.0967211Z","dateSort31":"2015-05-10T04:47:09.0967211Z","doubleSort11":18.0,"doubleSort21":67884.18,"doubleSort31":54262.600000000006,"author1":54262.600000000006},"id":"7","rank":0.0,"dcn":"DCN7"}  
{ "index" : {"\_type":"document","\_id":"8"} }  
{"customFields":{"numSort11":"8","numSort21":24866,"numSort31":11074,"numSort41":24866,"author2":"two","author3":"four  
five","author4":"six  
seven","dateSort21":"2015-05-12T04:47:09.1894981Z","dateSort31":"2015-05-10T04:47:09.1894981Z","doubleSort11":18.0,"doubleSort21":67884.18,"doubleSort31":54262.600000000006,"author1":54262.600000000006},"id":"8","rank":0.0,"dcn":"DCN8"}  
{ "index" : {"\_type":"document","\_id":"9"} }  
{"customFields":{"numSort11":"9","numSort21":24866,"numSort31":11074,"numSort41":24866,"author2":"two","author3":"four  
five","author4":"six  
seven","dateSort21":"2015-05-12T04:47:09.2793453Z","dateSort31":"2015-05-10T04:47:09.2793453Z","doubleSort11":18.0,"doubleSort21":67884.18,"doubleSort31":54262.600000000006,"author1":54262.600000000006},"id":"9","rank":0.0,"dcn":"DCN9"}  
{ "index" : {"\_type":"document","\_id":"10"} }  
{"customFields":{"numSort11":"10","numSort21":24866,"numSort31":11074,"numSort41":24866,"author2":"two","author3":"four  
five","author4":"six  
seven","dateSort21":"2015-05-12T04:47:09.3721223Z","dateSort31":"2015-05-10T04:47:09.3721223Z","doubleSort11":18.0,"doubleSort21":67884.18,"doubleSort31":54262.600000000006,"author1":54262.600000000006},"id":"10","rank":0.0,"dcn":"DCN10"}

Index field mapping :

"mappings": {

- "document": {
  - "dynamic": "strict",
  - "date\_detection": false,
  - "properties": {
    - "id": {
      - "type": "long"  
},

    - "title": {
      - "type": "string"  
},

    - "text": {
      - "type": "string"  
},

    - "rank": {
      - "type": "float"  
},

    - "customFields": {
      - "properties": {
        - "numSort31": {
          - "index\_name": "cfm037",
          - "index": "analyzed",
          - "type": "double"  
},

        - "numSort21": {
          - "index\_name": "cfm037",
          - "index": "analyzed",
          - "type": "double"  
},

        - "doubleSort11": {
          - "index\_name": "cfm037",
          - "index": "analyzed",
          - "type": "double"  
},

        - "numSort41": {
          - "index\_name": "cfm037",
          - "index": "analyzed",
          - "type": "double"  
},

        - "doubleSort21": {
          - "index\_name": "cfm037",
          - "index": "analyzed",
          - "type": "double"  
},

        - "numSort11": {
          - "index\_name": "cfm037",
          - "index": "analyzed",
          - "type": "double"  
},

        - "doubleSort31": {
          - "index\_name": "cfm037",
          - "index": "analyzed",
          - "type": "double"  
},

        - "doubleSort41": {
          - "index\_name": "cfm037",
          - "index": "analyzed",
          - "type": "double"  
},

        - "author4": {
          - "index\_name": "cfm037",
          - "type": "string",
          - "fields": {
            - "author4\_na": {
              - "index\_name": "cfm037",
              - "index": "not\_analyzed",
              - "type": "string"  
}  
}  
},

        - "author3": {
          - "index\_name": "cfm037",
          - "type": "string",
          - "fields": {
            - "author3\_na": {
              - "index\_name": "cfm037",
              - "index": "not\_analyzed",
              - "type": "string"  
}  
}  
},

        - "author5": {
          - "index\_name": "cfm037",
          - "type": "string",
          - "fields": {
            - "author5\_na": {
              - "index\_name": "cfm037",
              - "index": "not\_analyzed",
              - "type": "string"  
}  
}  
},

        - "dateSort11": {
          - "index\_name": "cfm037",
          - "index": "analyzed",
          - "format": "dateOptionalTime",
          - "type": "date"  
},

        - "author2": {
          - "index\_name": "cfm037",
          - "type": "string",
          - "fields": {
            - "author2\_na": {
              - "index\_name": "cfm037",
              - "index": "not\_analyzed",
              - "type": "string"  
}  
}  
},

        - "dateSort41": {
          - "index\_name": "cfm037",
          - "index": "analyzed",
          - "format": "dateOptionalTime",
          - "type": "date"  
},

        - "author1": {
          - "index\_name": "cfm037",
          - "type": "string",
          - "fields": {
            - "author1\_na": {
              - "index\_name": "cfm037",
              - "index": "not\_analyzed",
              - "type": "string"  
}  
}  
},

        - "dateSort31": {
          - "index\_name": "cfm037",
          - "index": "analyzed",
          - "format": "dateOptionalTime",
          - "type": "date"  
},

        - "dateSort21": {
          - "index\_name": "cfm037",
          - "index": "analyzed",
          - "format": "dateOptionalTime",
          - "type": "date"  
}  
}  
},

    - }

iInde

## -- Please update your bookmarks! We have moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/29b282b1-5415-41ff-aeac-843706d28f5d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/29b282b1-5415-41ff-aeac-843706d28f5d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:14am UTC](https://discuss.elastic.co/t/number-format-exception-for-a-string/23602/2 "2017-07-06T00:14:42Z")

</div>


