# Java.lang.NumberFormatException when doing geo searches

**URL:** <https://discuss.elastic.co/t/java-lang-numberformatexception-when-doing-geo-searches/13720>\
**Category:** Elasticsearch\
**Created:** [September 23, 2013, 7:44am UTC](https://discuss.elastic.co/t/java-lang-numberformatexception-when-doing-geo-searches/13720 "2013-09-23T07:44:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![martin\_hoegh](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@martin\_hoegh](https://discuss.elastic.co/u/martin_hoegh)\
**Post date:** [September 23, 2013, 7:44am UTC](https://discuss.elastic.co/t/java-lang-numberformatexception-when-doing-geo-searches/13720/1 "2013-09-23T07:44:46Z")

</div>

I've indexed documents in this form (GeoJSON):  
{  
"geometry":{  
"type":"Point",  
"coordinates":[  
12.216,  
55.648  
]  
},  
"type":"Feature",  
"properties":{  
"gid":30,  
"text":"Man bliver #moppet mere"  
}  
}

With the mapping:

{ "mappings" : {  
"hedehusene" : {  
"properties" : {  
"properties.text" : {  
"type" : "string",  
"search\_analyzer" : "str\_search\_analyzer",  
"index\_analyzer" : "str\_index\_analyzer"  
},  
"geometry.coordinates" : {  
"type" : "geo\_point" }  
}  
}  
},  
"settings" : {  
"analysis" : {  
"analyzer" : {  
"str\_search\_analyzer" : {  
"tokenizer" : "whitespace",  
"filter" : ["lowercase"]  
},  
"str\_index\_analyzer" : {  
"tokenizer" : "whitespace",  
"filter" : ["lowercase", "substring"]  
}  
},  
"filter" : {  
"substring" : {  
"type" : "edgeNGram",  
"min\_gram" : 1,  
"max\_gram" : 255  
}  
}  
}  
}  
}

When I run a query with a geo filter like this:

{  
"query": {  
"filtered": {  
"query": {  
"query\_string": {  
"default\_field": "text",  
"query": "godt",  
"default\_operator": "AND"  
}  
},  
"filter": {  
"geo\_bounding\_box": {  
"geometry.coordinates": {  
"top\_left": {  
"lat": 40.73,  
"lon": -74.1  
},  
"bottom\_right": {  
"lat": 40.717,  
"lon": -73.99  
}  
}  
}  
}  
}  
}  
}

I get exceptions like this:

query[filtered(properties.text:godt)-\>GeoBoundingBoxFilter(geometry.coordinates, [40.73, -74.1], [40.717, -73.99])],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: ElasticSearchException[java.lang.NumberFormatException: For input string: "@\u0014\u00176"h9"]

With out the geo filtering queries runs all right. I'm using version 0.90.5 on a Ubuntu 12.04 Server

--  
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:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [September 23, 2013, 4:30pm UTC](https://discuss.elastic.co/t/java-lang-numberformatexception-when-doing-geo-searches/13720/2 "2013-09-23T16:30:59Z")

</div>

Hi,

You need to give explicit definitions of the nested JSON objects on the  
path yo your geo point. Here is a curl recreation that should help you  
solve this problem:

> <https://gist.github.com/jpountz/6673167>

--  
Adrien Grand

--  
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:** ![martin\_hoegh](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@martin\_hoegh](https://discuss.elastic.co/u/martin_hoegh)\
**Post date:** [September 23, 2013, 5:59pm UTC](https://discuss.elastic.co/t/java-lang-numberformatexception-when-doing-geo-searches/13720/3 "2013-09-23T17:59:24Z")

</div>

Thanks. It works.

/Martin

On Monday, September 23, 2013 6:30:59 PM UTC+2, Adrien Grand wrote:

> Hi,
> 
> You need to give explicit definitions of the nested JSON objects on the  
> path yo your geo point. Here is a curl recreation that should help you  
> solve this problem:  
> [geo.bash · GitHub](https://gist.github.com/jpountz/6673167)
> 
> --  
> Adrien Grand

--  
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:15am UTC](https://discuss.elastic.co/t/java-lang-numberformatexception-when-doing-geo-searches/13720/4 "2017-07-06T02:15:05Z")

</div>


