# Geolocation mapping

**URL:** <https://discuss.elastic.co/t/geolocation-mapping/7526>\
**Category:** Elasticsearch\
**Created:** [May 1, 2012, 5:01pm UTC](https://discuss.elastic.co/t/geolocation-mapping/7526 "2012-05-01T17:01:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![phoenix](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phoenix/32/1319_2.png) [@phoenix](https://discuss.elastic.co/u/phoenix)\
**Post date:** [May 1, 2012, 5:01pm UTC](https://discuss.elastic.co/t/geolocation-mapping/7526/1 "2012-05-01T17:01:28Z")

</div>

Hi all  
I'm facing a problem.  
I have documents containing geoloacation data. But when i querya gographic  
query, i get an error, saying 'the 'location' field is not a geo\_point  
type'.

I tried to remove my index and create a mapping this way :

curl -XPUT '[http://localhost:9200/vo/vehicle/\_mapping](http://localhost:9200/vo/vehicle/_mapping)' -d ' { "vehicle" : {  
"properties" : { "LOCATION" : {"type" : "geo\_point"} } } } '

But the answer was that the index did not exist.

So i tried to reindex all my documents then send again my mapping query, to  
let elastic search know that this field is a geo point. But this answer was  
this :  
{"error":"MergeMappingException[Merge failed with failures {[Can't merge a  
non object mapping [LOCATION] with an object mapping  
[LOCATION]]}]","status":400}

So what is the way to tell elasticsearch that one of the fields of my  
documents is a geo\_point ?

Phoenix

---

<div class="post-metadata">

**Author:** ![phoenix](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phoenix/32/1319_2.png) [@phoenix](https://discuss.elastic.co/u/phoenix)\
**Post date:** [May 1, 2012, 5:09pm UTC](https://discuss.elastic.co/t/geolocation-mapping/7526/2 "2012-05-01T17:09:05Z")

</div>

To add more info, i try to query for non geolocation and get this :  
{  
"took" : 669,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
},  
"hits" : {  
"total" : 64,  
"max\_score" : 2.6279442,  
"hits" : [ {  
"\_index" : "vo",  
"\_type" : "vehicle",  
"\_id" : "9e5aa7b5-1d94-4b2f-b0f8-04203bc372c2",  
"\_score" : 2.6279442,  
"fields" : {  
"LOCATION" : {  
"lon" : 2.3139300028483074,  
"lat" : 48.88087158203125  
},  
"MILEAGE" : 11900,  
"NAME" : "RENAULT PARIS RIVE DROITE"  
}  
}, {  
"\_index" : "vo",  
"\_type" : "vehicle",  
"\_id" : "ce0685ec-5500-42c5-b2d6-66ca9c0a8762",  
"\_score" : 2.6279442,  
"fields" : {  
"LOCATION" : {  
"lon" : 2.3139300028483074,  
"lat" : 48.88087158203125  
},  
"MILEAGE" : 12023,  
"NAME" : "RENAULT PARIS RIVE DROITE"  
}

I try to ask for a geolocation query and get :

Exception in thread "main"  
org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to  
execute phase [query], total failure; shardFailures  
{[2\_QvJ3V4TJur7pSNh1nDeA][vo][4]: SearchParseException[[vo][4]:  
from[0],size[10]: Parse Failure [Failed to parse source [🙂  
򃦲omsizeԄquery򇦩ltered򂺈match\_all򻻅filter򋧥o\_distance򏶥hicle.LOCATION𩀀\<e"D)@$eJe]nw\<񇤩stanceD5.0km󻻻  
fieldsꃁRROSSERIEFMILEAGECNAME񻀀]]]; nested: QueryParsingException[[vo]  
failed to find geo\_point field [vehicle.LOCATION]];  
}{[2\_QvJ3V4TJur7pSNh1nDeA][vo][1]: SearchParseException[[vo][1]:  
from[0],size[10]: Parse Failure [Failed to parse source [🙂  
򃦲omsizeԄquery򇦩ltered򂺈match\_all򻻅filter򋧥o\_distance򏶥hicle.LOCATION𩀀\<e"D)@$eJe]nw\<񇤩stanceD5.0km󻻻  
fieldsꃁRROSSERIEFMILEAGECNAME񻀀]]]; nested: QueryParsingException[[vo]  
failed to find geo\_point field [vehicle.LOCATION]]; }  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:259)  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$3.onFailure(TransportSearchTypeAction.java:212)  
at  
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:143)  
at  
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:204)  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:177)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)  
at java.lang.Thread.run(Thread.java:680)

Process finished with exit code 1  
Le mardi 1 mai 2012 19:01:28 UTC+2, Frederic Esnault a écrit :

> Hi all  
> I'm facing a problem.  
> I have documents containing geoloacation data. But when i querya gographic  
> query, i get an error, saying 'the 'location' field is not a geo\_point  
> type'.
> 
> I tried to remove my index and create a mapping this way :
> 
> curl -XPUT '[http://localhost:9200/vo/vehicle/\_mapping](http://localhost:9200/vo/vehicle/_mapping)' -d ' { "vehicle" :  
> { "properties" : { "LOCATION" : {"type" : "geo\_point"} } } } '
> 
> But the answer was that the index did not exist.
> 
> So i tried to reindex all my documents then send again my mapping query,  
> to let Elasticsearch know that this field is a geo point. But this answer  
> was this :  
> {"error":"MergeMappingException[Merge failed with failures {[Can't merge a  
> non object mapping [LOCATION] with an object mapping  
> [LOCATION]]}]","status":400}
> 
> So what is the way to tell elasticsearch that one of the fields of my  
> documents is a geo\_point ?
> 
> Phoenix

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [May 2, 2012, 3:58am UTC](https://discuss.elastic.co/t/geolocation-mapping/7526/3 "2012-05-02T03:58:04Z")

</div>

Try deleting the index, then creating the index, and then putting mapping  
into the index before adding any data.

curl -XDELETE '[http://localhost:9200/vo](http://localhost:9200/vo)'  
curl -XPUT '[http://localhost:9200/vo](http://localhost:9200/vo)'  
curl -XPUT '[http://localhost:9200/vo/vehicle/\_mapping](http://localhost:9200/vo/vehicle/_mapping)' -d ' { "vehicle" : {  
"properties" : { "LOCATION" : {"type" : "geo\_point"} } } } '

On Tuesday, May 1, 2012 1:09:05 PM UTC-4, Frederic Esnault wrote:

> To add more info, i try to query for non geolocation and get this :  
> {  
> "took" : 669,  
> "timed\_out" : false,  
> "\_shards" : {  
> "total" : 5,  
> "successful" : 5,  
> "failed" : 0  
> },  
> "hits" : {  
> "total" : 64,  
> "max\_score" : 2.6279442,  
> "hits" : [ {  
> "\_index" : "vo",  
> "\_type" : "vehicle",  
> "\_id" : "9e5aa7b5-1d94-4b2f-b0f8-04203bc372c2",  
> "\_score" : 2.6279442,  
> "fields" : {  
> "LOCATION" : {  
> "lon" : 2.3139300028483074,  
> "lat" : 48.88087158203125  
> },  
> "MILEAGE" : 11900,  
> "NAME" : "RENAULT PARIS RIVE DROITE"  
> }  
> }, {  
> "\_index" : "vo",  
> "\_type" : "vehicle",  
> "\_id" : "ce0685ec-5500-42c5-b2d6-66ca9c0a8762",  
> "\_score" : 2.6279442,  
> "fields" : {  
> "LOCATION" : {  
> "lon" : 2.3139300028483074,  
> "lat" : 48.88087158203125  
> },  
> "MILEAGE" : 12023,  
> "NAME" : "RENAULT PARIS RIVE DROITE"  
> }
> 
> I try to ask for a geolocation query and get :
> 
> Exception in thread "main"  
> org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to  
> execute phase [query], total failure; shardFailures  
> {[2\_QvJ3V4TJur7pSNh1nDeA][vo][4]: SearchParseException[[vo][4]:  
> from[0],size[10]: Parse Failure [Failed to parse source [🙂  
> 򃦲omsizeԄquery򇦩ltered򂺈match\_all򻻅filter򋧥o\_distance򏶥hicle.LOCATION𩀀\<e"D)@$eJe]nw\<񇤩stanceD5.0km󻻻  
> fieldsꃁRROSSERIEFMILEAGECNAME񻀀]]]; nested: QueryParsingException[[vo]  
> failed to find geo\_point field [vehicle.LOCATION]];  
> }{[2\_QvJ3V4TJur7pSNh1nDeA][vo][1]: SearchParseException[[vo][1]:  
> from[0],size[10]: Parse Failure [Failed to parse source [🙂  
> 򃦲omsizeԄquery򇦩ltered򂺈match\_all򻻅filter򋧥o\_distance򏶥hicle.LOCATION𩀀\<e"D)@$eJe]nw\<񇤩stanceD5.0km󻻻  
> fieldsꃁRROSSERIEFMILEAGECNAME񻀀]]]; nested: QueryParsingException[[vo]  
> failed to find geo\_point field [vehicle.LOCATION]]; }  
> at  
> org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:259)  
> at  
> org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$3.onFailure(TransportSearchTypeAction.java:212)  
> at  
> org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:143)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)  
> at  
> org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:204)  
> at  
> org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)  
> at  
> org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:177)  
> at  
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)  
> at  
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)  
> at java.lang.Thread.run(Thread.java:680)
> 
> Process finished with exit code 1  
> Le mardi 1 mai 2012 19:01:28 UTC+2, Frederic Esnault a écrit :
> 
> > Hi all  
> > I'm facing a problem.  
> > I have documents containing geoloacation data. But when i querya  
> > gographic query, i get an error, saying 'the 'location' field is not a  
> > geo\_point type'.
> > 
> > I tried to remove my index and create a mapping this way :
> > 
> > curl -XPUT '[http://localhost:9200/vo/vehicle/\_mapping](http://localhost:9200/vo/vehicle/_mapping)' -d ' { "vehicle"  
> > : { "properties" : { "LOCATION" : {"type" : "geo\_point"} } } } '
> > 
> > But the answer was that the index did not exist.
> > 
> > So i tried to reindex all my documents then send again my mapping query,  
> > to let Elasticsearch know that this field is a geo point. But this answer  
> > was this :  
> > {"error":"MergeMappingException[Merge failed with failures {[Can't merge  
> > a non object mapping [LOCATION] with an object mapping  
> > [LOCATION]]}]","status":400}
> > 
> > So what is the way to tell elasticsearch that one of the fields of my  
> > documents is a geo\_point ?
> > 
> > Phoenix

---

<div class="post-metadata">

**Author:** ![phoenix](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phoenix/32/1319_2.png) [@phoenix](https://discuss.elastic.co/u/phoenix)\
**Post date:** [May 2, 2012, 5:12am UTC](https://discuss.elastic.co/t/geolocation-mapping/7526/4 "2012-05-02T05:12:42Z")

</div>

Thx, I'll try this tonight.  
Frederic  
Le 2 mai 2012 05:58, "Igor Motov" [imotov@gmail.com](mailto:imotov@gmail.com) a écrit :

> Try deleting the index, then creating the index, and then putting mapping  
> into the index before adding any data.
> 
> curl -XDELETE '[http://localhost:9200/vo](http://localhost:9200/vo)'  
> curl -XPUT '[http://localhost:9200/vo](http://localhost:9200/vo)'  
> curl -XPUT '[http://localhost:9200/vo/vehicle/\_mapping](http://localhost:9200/vo/vehicle/_mapping)' -d ' { "vehicle" :  
> { "properties" : { "LOCATION" : {"type" : "geo\_point"} } } } '
> 
> On Tuesday, May 1, 2012 1:09:05 PM UTC-4, Frederic Esnault wrote:
> 
> > To add more info, i try to query for non geolocation and get this :  
> > {  
> > "took" : 669,  
> > "timed\_out" : false,  
> > "\_shards" : {  
> > "total" : 5,  
> > "successful" : 5,  
> > "failed" : 0  
> > },  
> > "hits" : {  
> > "total" : 64,  
> > "max\_score" : 2.6279442,  
> > "hits" : [ {  
> > "\_index" : "vo",  
> > "\_type" : "vehicle",  
> > "\_id" : "9e5aa7b5-1d94-4b2f-b0f8-\*\*04203bc372c2",  
> > "\_score" : 2.6279442,  
> > "fields" : {  
> > "LOCATION" : {  
> > "lon" : 2.3139300028483074,  
> > "lat" : 48.88087158203125  
> > },  
> > "MILEAGE" : 11900,  
> > "NAME" : "RENAULT PARIS RIVE DROITE"  
> > }  
> > }, {  
> > "\_index" : "vo",  
> > "\_type" : "vehicle",  
> > "\_id" : "ce0685ec-5500-42c5-b2d6-\*\*66ca9c0a8762",  
> > "\_score" : 2.6279442,  
> > "fields" : {  
> > "LOCATION" : {  
> > "lon" : 2.3139300028483074,  
> > "lat" : 48.88087158203125  
> > },  
> > "MILEAGE" : 12023,  
> > "NAME" : "RENAULT PARIS RIVE DROITE"  
> > }
> > 
> > I try to ask for a geolocation query and get :
> > 
> > Exception in thread "main" org.elasticsearch.action.**search.SearchPhaseExecutionException:  
> > Failed to execute phase [query], total failure; shardFailures  
> > {[2\_QvJ3V4TJur7pSNh1nDeA][vo][4]: SearchParseException[[vo][4]:  
> > from[0],size[10]: Parse Failure [Failed to parse source [🙂  
> > 򃦲om sizeԄquery򇦩ltered򂺈match\_all򻻅filter򋧥o\_distance򏶥hicle.LOCATION𩀀  
> > \< " D)@$ J ]nw\<񇤩stanceD5.0km󻻻…fieldsꃁRROSSERIEFMILEAGECNAME񻀀]]];  
> > nested: QueryParsingException[[vo] failed to find geo\_point field  
> > [vehicle.LOCATION]]; }{[2\_QvJ3V4TJur7pSNh1nDeA][vo]**[1]:  
> > SearchParseException[[vo][1]: from[0],size[10]: Parse Failure [Failed to  
> > parse source [🙂  
> > 򃦲om sizeԄquery򇦩ltered򂺈 **match\_all򻻅filter򋧥o\_distance** 򏶥hicle.LOCATION𩀀  
> > \< " D)@$ **J ]nw\<񇤩stanceD5.0km󻻻…fieldsꃁRROSSERIEFMILEAGECNAME**񻀀]]];  
> > nested: QueryParsingException[[vo] failed to find geo\_point field  
> > [vehicle.LOCATION]]; }  
> > at org.elasticsearch.action.\*\*search.type. **TransportSearchTypeAction$**  
> > BaseAsyncAction.\*\*onFirstPhaseResult( **TransportSearchTypeAction.**  
> > java:259)  
> > at org.elasticsearch.action.\*\*search.type. **TransportSearchTypeAction$**  
> > BaseAsyncAction$3.onFailure(\*\*TransportSearchTypeAction.\*\*java:212)  
> > at org.elasticsearch.search.\*\*action. **SearchServiceTransportAction.**  
> > sendExecuteQuery(**SearchServiceTransportAction.java:143)  
> > at org.elasticsearch.action.search.type.  
> > TransportSearchQueryThenFetchAction$AsyncAction.**  
> > sendExecuteFirstPhase( **TransportSearchQueryThenFetchA** ction.java:80)  
> > at org.elasticsearch.action.\*\*search.type. **TransportSearchTypeAction$**  
> > BaseAsyncAction.\*\*performFirstPhase( **TransportSearchTypeAction.**  
> > java:204)  
> > at org.elasticsearch.action.\*\*search.type. **TransportSearchTypeAction$**  
> > BaseAsyncAction.\*\*performFirstPhase( **TransportSearchTypeAction.**  
> > java:191)  
> > at org.elasticsearch.action.\*\*search.type. **TransportSearchTypeAction$**  
> > BaseAsyncAction$2.run(\*\*TransportSearchTypeAction.\*\*java:177)  
> > at java.util.concurrent. **ThreadPoolExecutor$Worker.**  
> > runTask(ThreadPoolExecutor.\*\*java:886)  
> > at java.util.concurrent.**ThreadPoolExecutor$Worker.run(**  
> > ThreadPoolExecutor.java:908)  
> > at java.lang.Thread.run(Thread.\*\*java:680)
> > 
> > Process finished with exit code 1  
> > Le mardi 1 mai 2012 19:01:28 UTC+2, Frederic Esnault a écrit :
> > 
> > > Hi all  
> > > I'm facing a problem.  
> > > I have documents containing geoloacation data. But when i querya  
> > > gographic query, i get an error, saying 'the 'location' field is not a  
> > > geo\_point type'.
> > > 
> > > I tried to remove my index and create a mapping this way :
> > > 
> > > curl -XPUT '[http://localhost:9200/vo/\*\*vehicle/\_mapping](http://localhost:9200/vo/**vehicle/_mapping)[http://localhost:9200/vo/vehicle/\_mapping](http://localhost:9200/vo/vehicle/_mapping)'  
> > > -d ' { "vehicle" : { "properties" : { "LOCATION" : {"type" : "geo\_point"}  
> > > } } } '
> > > 
> > > But the answer was that the index did not exist.
> > > 
> > > So i tried to reindex all my documents then send again my mapping query,  
> > > to let Elasticsearch know that this field is a geo point. But this answer  
> > > was this :  
> > > {"error":"\*\*MergeMappingException[Merge failed with failures {[Can't  
> > > merge a non object mapping [LOCATION] with an object mapping  
> > > [LOCATION]]}]","status":400}
> > > 
> > > So what is the way to tell elasticsearch that one of the fields of my  
> > > documents is a geo\_point ?
> > > 
> > > Phoenix

---

<div class="post-metadata">

**Author:** ![phoenix](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phoenix/32/1319_2.png) [@phoenix](https://discuss.elastic.co/u/phoenix)\
**Post date:** [May 4, 2012, 7:32pm UTC](https://discuss.elastic.co/t/geolocation-mapping/7526/5 "2012-05-04T19:32:19Z")

</div>

Thanks Igor, that did the trick !  
I could send the mapping for this particular fields, and my geolocated  
query worked perfectly.  
The only thing is it took 1530 ms to execute... I guess geolocated searches  
must be slower than 'regular' ones, but in which proportion ? I'm afraid of  
gelocated searches on really big indexes (hundreds of thousand,  
millions...).  
Ok my index is not that big, (around 30k docs).

Any clue about performance impact of geolocation ? Any clue on how it may  
be improved ?

Frederic

Le mercredi 2 mai 2012 07:12:42 UTC+2, Frederic Esnault a écrit :

> Thx, I'll try this tonight.  
> Frederic  
> Le 2 mai 2012 05:58, "Igor Motov" a écrit :
> 
> > Try deleting the index, then creating the index, and then putting mapping  
> > into the index before adding any data.
> > 
> > curl -XDELETE '[http://localhost:9200/vo](http://localhost:9200/vo)'  
> > curl -XPUT '[http://localhost:9200/vo](http://localhost:9200/vo)'  
> > curl -XPUT '[http://localhost:9200/vo/vehicle/\_mapping](http://localhost:9200/vo/vehicle/_mapping)' -d ' { "vehicle"  
> > : { "properties" : { "LOCATION" : {"type" : "geo\_point"} } } } '
> > 
> > On Tuesday, May 1, 2012 1:09:05 PM UTC-4, Frederic Esnault wrote:
> > 
> > > To add more info, i try to query for non geolocation and get this :  
> > > {  
> > > "took" : 669,  
> > > "timed\_out" : false,  
> > > "\_shards" : {  
> > > "total" : 5,  
> > > "successful" : 5,  
> > > "failed" : 0  
> > > },  
> > > "hits" : {  
> > > "total" : 64,  
> > > "max\_score" : 2.6279442,  
> > > "hits" : [ {  
> > > "\_index" : "vo",  
> > > "\_type" : "vehicle",  
> > > "\_id" : "9e5aa7b5-1d94-4b2f-b0f8-\*\*04203bc372c2",  
> > > "\_score" : 2.6279442,  
> > > "fields" : {  
> > > "LOCATION" : {  
> > > "lon" : 2.3139300028483074,  
> > > "lat" : 48.88087158203125  
> > > },  
> > > "MILEAGE" : 11900,  
> > > "NAME" : "RENAULT PARIS RIVE DROITE"  
> > > }  
> > > }, {  
> > > "\_index" : "vo",  
> > > "\_type" : "vehicle",  
> > > "\_id" : "ce0685ec-5500-42c5-b2d6-\*\*66ca9c0a8762",  
> > > "\_score" : 2.6279442,  
> > > "fields" : {  
> > > "LOCATION" : {  
> > > "lon" : 2.3139300028483074,  
> > > "lat" : 48.88087158203125  
> > > },  
> > > "MILEAGE" : 12023,  
> > > "NAME" : "RENAULT PARIS RIVE DROITE"  
> > > }
> > > 
> > > I try to ask for a geolocation query and get :
> > > 
> > > Exception in thread "main" org.elasticsearch.action.**search.SearchPhaseExecutionException:  
> > > Failed to execute phase [query], total failure; shardFailures  
> > > {[2\_QvJ3V4TJur7pSNh1nDeA][vo][4]: SearchParseException[[vo][4]:  
> > > from[0],size[10]: Parse Failure [Failed to parse source [🙂  
> > > 򃦲om sizeԄquery򇦩ltered򂺈match\_all򻻅filter򋧥o\_distance򏶥hicle.LOCATION𩀀  
> > > \< " D)@$ J ]nw\<񇤩stanceD5.0km󻻻…fieldsꃁRROSSERIEFMILEAGECNAME񻀀]]];  
> > > nested: QueryParsingException[[vo] failed to find geo\_point field  
> > > [vehicle.LOCATION]]; }{[2\_QvJ3V4TJur7pSNh1nDeA][vo]**[1]:  
> > > SearchParseException[[vo][1]: from[0],size[10]: Parse Failure [Failed to  
> > > parse source [🙂  
> > > 򃦲om sizeԄquery򇦩ltered򂺈 **match\_all򻻅filter򋧥o\_distance** 򏶥hicle.LOCATION𩀀  
> > > \< " D)@$ **J ]nw\<񇤩stanceD5.0km󻻻…fieldsꃁRROSSERIEFMILEAGECNAME**񻀀]]];  
> > > nested: QueryParsingException[[vo] failed to find geo\_point field  
> > > [vehicle.LOCATION]]; }  
> > > at org.elasticsearch.action.\*\*search.type.\*_TransportSearchTypeAction$_  
> > > \*BaseAsyncAction.\*\*onFirstPhaseResult( **TransportSearchTypeAction.**  
> > > java:259)  
> > > at org.elasticsearch.action.\*\*search.type.\*_TransportSearchTypeAction$_  
> > > \*BaseAsyncAction$3.onFailure(\*\*TransportSearchTypeAction.\*\*java:212)  
> > > at org.elasticsearch.search.\*\*action. **SearchServiceTransportAction.**  
> > > sendExecuteQuery(**SearchServiceTransportAction.java:143)  
> > > at org.elasticsearch.action.search.type.  
> > > TransportSearchQueryThenFetchAction$AsyncAction.**  
> > > sendExecuteFirstPhase( **TransportSearchQueryThenFetchA** ction.java:80)  
> > > at org.elasticsearch.action.\*\*search.type.\*_TransportSearchTypeAction$_  
> > > \*BaseAsyncAction.\*\*performFirstPhase( **TransportSearchTypeAction.**  
> > > java:204)  
> > > at org.elasticsearch.action.\*\*search.type.\*_TransportSearchTypeAction$_  
> > > \*BaseAsyncAction.\*\*performFirstPhase( **TransportSearchTypeAction.**  
> > > java:191)  
> > > at org.elasticsearch.action.\*\*search.type.\*_TransportSearchTypeAction$_  
> > > \*BaseAsyncAction$2.run(\*\*TransportSearchTypeAction.\*\*java:177)  
> > > at java.util.concurrent. **ThreadPoolExecutor$Worker.**  
> > > runTask(ThreadPoolExecutor.\*\*java:886)  
> > > at java.util.concurrent.**ThreadPoolExecutor$Worker.run(**  
> > > ThreadPoolExecutor.java:908)  
> > > at java.lang.Thread.run(Thread.\*\*java:680)
> > > 
> > > Process finished with exit code 1  
> > > Le mardi 1 mai 2012 19:01:28 UTC+2, Frederic Esnault a écrit :
> > > 
> > > > Hi all  
> > > > I'm facing a problem.  
> > > > I have documents containing geoloacation data. But when i querya  
> > > > gographic query, i get an error, saying 'the 'location' field is not a  
> > > > geo\_point type'.
> > > > 
> > > > I tried to remove my index and create a mapping this way :
> > > > 
> > > > curl -XPUT '[http://localhost:9200/vo/\*\*vehicle/\_mapping](http://localhost:9200/vo/**vehicle/_mapping)[http://localhost:9200/vo/vehicle/\_mapping](http://localhost:9200/vo/vehicle/_mapping)'  
> > > > -d ' { "vehicle" : { "properties" : { "LOCATION" : {"type" : "geo\_point"}  
> > > > } } } '
> > > > 
> > > > But the answer was that the index did not exist.
> > > > 
> > > > So i tried to reindex all my documents then send again my mapping  
> > > > query, to let Elasticsearch know that this field is a geo point. But this  
> > > > answer was this :  
> > > > {"error":"\*\*MergeMappingException[Merge failed with failures {[Can't  
> > > > merge a non object mapping [LOCATION] with an object mapping  
> > > > [LOCATION]]}]","status":400}
> > > > 
> > > > So what is the way to tell elasticsearch that one of the fields of my  
> > > > documents is a geo\_point ?
> > > > 
> > > > Phoenix

---

<div class="post-metadata">

**Author:** ![phoenix](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phoenix/32/1319_2.png) [@phoenix](https://discuss.elastic.co/u/phoenix)\
**Post date:** [May 4, 2012, 7:33pm UTC](https://discuss.elastic.co/t/geolocation-mapping/7526/6 "2012-05-04T19:33:50Z")

</div>

Wow i ran it again, and it took 44 ms...Maybe it was because it was the  
first query on the freshly filled index?

Le vendredi 4 mai 2012 21:32:19 UTC+2, Frederic Esnault a écrit :

> Thanks Igor, that did the trick !  
> I could send the mapping for this particular fields, and my geolocated  
> query worked perfectly.  
> The only thing is it took 1530 ms to execute... I guess geolocated  
> searches must be slower than 'regular' ones, but in which proportion ? I'm  
> afraid of gelocated searches on really big indexes (hundreds of thousand,  
> millions...).  
> Ok my index is not that big, (around 30k docs).
> 
> Any clue about performance impact of geolocation ? Any clue on how it may  
> be improved ?
> 
> Frederic
> 
> Le mercredi 2 mai 2012 07:12:42 UTC+2, Frederic Esnault a écrit :
> 
> > Thx, I'll try this tonight.  
> > Frederic  
> > Le 2 mai 2012 05:58, "Igor Motov" a écrit :
> > 
> > > Try deleting the index, then creating the index, and then putting  
> > > mapping into the index before adding any data.
> > > 
> > > curl -XDELETE '[http://localhost:9200/vo](http://localhost:9200/vo)'  
> > > curl -XPUT '[http://localhost:9200/vo](http://localhost:9200/vo)'  
> > > curl -XPUT '[http://localhost:9200/vo/vehicle/\_mapping](http://localhost:9200/vo/vehicle/_mapping)' -d ' { "vehicle"  
> > > : { "properties" : { "LOCATION" : {"type" : "geo\_point"} } } } '
> > > 
> > > On Tuesday, May 1, 2012 1:09:05 PM UTC-4, Frederic Esnault wrote:
> > > 
> > > > To add more info, i try to query for non geolocation and get this :  
> > > > {  
> > > > "took" : 669,  
> > > > "timed\_out" : false,  
> > > > "\_shards" : {  
> > > > "total" : 5,  
> > > > "successful" : 5,  
> > > > "failed" : 0  
> > > > },  
> > > > "hits" : {  
> > > > "total" : 64,  
> > > > "max\_score" : 2.6279442,  
> > > > "hits" : [ {  
> > > > "\_index" : "vo",  
> > > > "\_type" : "vehicle",  
> > > > "\_id" : "9e5aa7b5-1d94-4b2f-b0f8-\*\*04203bc372c2",  
> > > > "\_score" : 2.6279442,  
> > > > "fields" : {  
> > > > "LOCATION" : {  
> > > > "lon" : 2.3139300028483074,  
> > > > "lat" : 48.88087158203125  
> > > > },  
> > > > "MILEAGE" : 11900,  
> > > > "NAME" : "RENAULT PARIS RIVE DROITE"  
> > > > }  
> > > > }, {  
> > > > "\_index" : "vo",  
> > > > "\_type" : "vehicle",  
> > > > "\_id" : "ce0685ec-5500-42c5-b2d6-\*\*66ca9c0a8762",  
> > > > "\_score" : 2.6279442,  
> > > > "fields" : {  
> > > > "LOCATION" : {  
> > > > "lon" : 2.3139300028483074,  
> > > > "lat" : 48.88087158203125  
> > > > },  
> > > > "MILEAGE" : 12023,  
> > > > "NAME" : "RENAULT PARIS RIVE DROITE"  
> > > > }
> > > > 
> > > > I try to ask for a geolocation query and get :
> > > > 
> > > > Exception in thread "main" org.elasticsearch.action.**search.SearchPhaseExecutionException:  
> > > > Failed to execute phase [query], total failure; shardFailures  
> > > > {[2\_QvJ3V4TJur7pSNh1nDeA][vo][4]: SearchParseException[[vo][4]:  
> > > > from[0],size[10]: Parse Failure [Failed to parse source [🙂  
> > > > 򃦲om sizeԄquery򇦩ltered򂺈match\_all򻻅filter򋧥o\_distance򏶥hicle.LOCATION𩀀  
> > > > \< " D)@$ J ]nw\<񇤩stanceD5.0km󻻻…fieldsꃁRROSSERIEFMILEAGECNAME񻀀]]];  
> > > > nested: QueryParsingException[[vo] failed to find geo\_point field  
> > > > [vehicle.LOCATION]]; }{[2\_QvJ3V4TJur7pSNh1nDeA][vo]**[1]:  
> > > > SearchParseException[[vo][1]: from[0],size[10]: Parse Failure [Failed to  
> > > > parse source [🙂  
> > > > 򃦲om sizeԄquery򇦩ltered򂺈 **match\_all򻻅filter򋧥o\_distance** 򏶥hicle.LOCATION𩀀  
> > > > \< " D)@$ **J ]nw\<񇤩stanceD5.0km󻻻…fieldsꃁRROSSERIEFMILEAGECNAME**񻀀]]];  
> > > > nested: QueryParsingException[[vo] failed to find geo\_point field  
> > > > [vehicle.LOCATION]]; }  
> > > > at org.elasticsearch.action.\*\*search.type.\*\*TransportSearchTypeAction$  
> > > > \*\*BaseAsyncAction.\*\*onFirstPhaseResult( **TransportSearchTypeAction.**  
> > > > java:259)  
> > > > at org.elasticsearch.action.\*\*search.type.\*\*TransportSearchTypeAction$  
> > > > \*\*BaseAsyncAction$3.onFailure(\*\*TransportSearchTypeAction.\*\*java:212)  
> > > > at org.elasticsearch.search.\*\*action. **SearchServiceTransportAction.**  
> > > > sendExecuteQuery(**SearchServiceTransportAction.java:143)  
> > > > at org.elasticsearch.action.search.type.  
> > > > TransportSearchQueryThenFetchAction$AsyncAction.**  
> > > > sendExecuteFirstPhase( **TransportSearchQueryThenFetchA** ction.java:80)  
> > > > at org.elasticsearch.action.\*\*search.type.\*\*TransportSearchTypeAction$  
> > > > \*\*BaseAsyncAction.\*\*performFirstPhase( **TransportSearchTypeAction.**  
> > > > java:204)  
> > > > at org.elasticsearch.action.\*\*search.type.\*\*TransportSearchTypeAction$  
> > > > \*\*BaseAsyncAction.\*\*performFirstPhase( **TransportSearchTypeAction.**  
> > > > java:191)  
> > > > at org.elasticsearch.action.\*\*search.type.\*\*TransportSearchTypeAction$  
> > > > \*\*BaseAsyncAction$2.run(\*\*TransportSearchTypeAction.\*\*java:177)  
> > > > at java.util.concurrent. **ThreadPoolExecutor$Worker.**  
> > > > runTask(ThreadPoolExecutor.\*\*java:886)  
> > > > at java.util.concurrent.**ThreadPoolExecutor$Worker.run(**  
> > > > ThreadPoolExecutor.java:908)  
> > > > at java.lang.Thread.run(Thread.\*\*java:680)
> > > > 
> > > > Process finished with exit code 1  
> > > > Le mardi 1 mai 2012 19:01:28 UTC+2, Frederic Esnault a écrit :
> > > > 
> > > > > Hi all  
> > > > > I'm facing a problem.  
> > > > > I have documents containing geoloacation data. But when i querya  
> > > > > gographic query, i get an error, saying 'the 'location' field is not a  
> > > > > geo\_point type'.
> > > > > 
> > > > > I tried to remove my index and create a mapping this way :
> > > > > 
> > > > > curl -XPUT '[http://localhost:9200/vo/\*\*vehicle/\_mapping](http://localhost:9200/vo/**vehicle/_mapping)[http://localhost:9200/vo/vehicle/\_mapping](http://localhost:9200/vo/vehicle/_mapping)'  
> > > > > -d ' { "vehicle" : { "properties" : { "LOCATION" : {"type" : "geo\_point"}  
> > > > > } } } '
> > > > > 
> > > > > But the answer was that the index did not exist.
> > > > > 
> > > > > So i tried to reindex all my documents then send again my mapping  
> > > > > query, to let Elasticsearch know that this field is a geo point. But this  
> > > > > answer was this :  
> > > > > {"error":"\*\*MergeMappingException[Merge failed with failures {[Can't  
> > > > > merge a non object mapping [LOCATION] with an object mapping  
> > > > > [LOCATION]]}]","status":400}
> > > > > 
> > > > > So what is the way to tell elasticsearch that one of the fields of my  
> > > > > documents is a geo\_point ?
> > > > > 
> > > > > Phoenix

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 9, 2012, 8:24am UTC](https://discuss.elastic.co/t/geolocation-mapping/7526/7 "2012-05-09T08:24:13Z")

</div>

Yes, the first query will require loading the field values to memory to do  
the search faster, subsequent ones will be considerably faster.

On Fri, May 4, 2012 at 10:33 PM, Frederic Esnault \<  
[esnault.frederic@gmail.com](mailto:esnault.frederic@gmail.com)\> wrote:

> Wow i ran it again, and it took 44 ms...Maybe it was because it was the  
> first query on the freshly filled index?
> 
> Le vendredi 4 mai 2012 21:32:19 UTC+2, Frederic Esnault a écrit :
> 
> > Thanks Igor, that did the trick !  
> > I could send the mapping for this particular fields, and my geolocated  
> > query worked perfectly.  
> > The only thing is it took 1530 ms to execute... I guess geolocated  
> > searches must be slower than 'regular' ones, but in which proportion ? I'm  
> > afraid of gelocated searches on really big indexes (hundreds of thousand,  
> > millions...).  
> > Ok my index is not that big, (around 30k docs).
> > 
> > Any clue about performance impact of geolocation ? Any clue on how it may  
> > be improved ?
> > 
> > Frederic
> > 
> > Le mercredi 2 mai 2012 07:12:42 UTC+2, Frederic Esnault a écrit :
> > 
> > > Thx, I'll try this tonight.  
> > > Frederic  
> > > Le 2 mai 2012 05:58, "Igor Motov" a écrit :
> > > 
> > > > Try deleting the index, then creating the index, and then putting  
> > > > mapping into the index before adding any data.
> > > > 
> > > > curl -XDELETE '[http://localhost:9200/vo](http://localhost:9200/vo)'  
> > > > curl -XPUT '[http://localhost:9200/vo](http://localhost:9200/vo)'  
> > > > curl -XPUT '[http://localhost:9200/vo/\*\*vehicle/\_mapping](http://localhost:9200/vo/**vehicle/_mapping)[http://localhost:9200/vo/vehicle/\_mapping](http://localhost:9200/vo/vehicle/_mapping)'  
> > > > -d ' { "vehicle" : { "properties" : { "LOCATION" : {"type" : "geo\_point"}  
> > > > } } } '
> > > > 
> > > > On Tuesday, May 1, 2012 1:09:05 PM UTC-4, Frederic Esnault wrote:
> > > > 
> > > > > To add more info, i try to query for non geolocation and get this :  
> > > > > {  
> > > > > "took" : 669,  
> > > > > "timed\_out" : false,  
> > > > > "\_shards" : {  
> > > > > "total" : 5,  
> > > > > "successful" : 5,  
> > > > > "failed" : 0  
> > > > > },  
> > > > > "hits" : {  
> > > > > "total" : 64,  
> > > > > "max\_score" : 2.6279442,  
> > > > > "hits" : [ {  
> > > > > "\_index" : "vo",  
> > > > > "\_type" : "vehicle",  
> > > > > "\_id" : "9e5aa7b5-1d94-4b2f-b0f8- **04203** bc372c2",  
> > > > > "\_score" : 2.6279442,  
> > > > > "fields" : {  
> > > > > "LOCATION" : {  
> > > > > "lon" : 2.3139300028483074,  
> > > > > "lat" : 48.88087158203125  
> > > > > },  
> > > > > "MILEAGE" : 11900,  
> > > > > "NAME" : "RENAULT PARIS RIVE DROITE"  
> > > > > }  
> > > > > }, {  
> > > > > "\_index" : "vo",  
> > > > > "\_type" : "vehicle",  
> > > > > "\_id" : "ce0685ec-5500-42c5-b2d6- **66ca9** c0a8762",  
> > > > > "\_score" : 2.6279442,  
> > > > > "fields" : {  
> > > > > "LOCATION" : {  
> > > > > "lon" : 2.3139300028483074,  
> > > > > "lat" : 48.88087158203125  
> > > > > },  
> > > > > "MILEAGE" : 12023,  
> > > > > "NAME" : "RENAULT PARIS RIVE DROITE"  
> > > > > }
> > > > > 
> > > > > I try to ask for a geolocation query and get :
> > > > > 
> > > > > Exception in thread "main" org.elasticsearch.action. **searc** h.\*\*  
> > > > > SearchPhaseExecutionExceptio**n: Failed to execute phase [query],  
> > > > > total failure; shardFailures {[2\_QvJ3V4TJur7pSNh1nDeA][vo][\*\*\*\*4]:  
> > > > > SearchParseException[[vo][4]: from[0],size[10]: Parse Failure [Failed to  
> > > > > parse source [🙂  
> > > > > 򃦲om sizeԄquery򇦩ltered򂺈 **match\_all** 򻻅filter򋧥o\_distance**򏶥hicle.\*  
> > > > > _LOCATION𩀀 \< " D)@$ **J ]nw\<񇤩stanceD5.0km󻻻…**  
> > > > > fieldsꃁRROSSERIEFMILEAGECNAME__**񻀀]]]; nested:  
> > > > > QueryParsingException[[vo] failed to find geo\_point field  
> > > > > [vehicle.LOCATION]]; }{[2\_QvJ3V4TJur7pSNh1nDeA][vo]**__[1]:  
> > > > > SearchParseException[[vo][1]: from[0],size[10]: Parse Failure [Failed to  
> > > > > parse source [🙂  
> > > > > 򃦲om sizeԄquery򇦩ltered򂺈 **match\_all** 򻻅filter򋧥o\_distance\*\*򏶥hicle._  
> > > > > _LOCATION𩀀 \< " D)@$ **J ]nw\<񇤩stanceD5.0km󻻻…**  
> > > > > fieldsꃁRROSSERIEFMILEAGECNAME_\*\*\*񻀀]]]; nested:  
> > > > > QueryParsingException[[vo] failed to find geo\_point field  
> > > > > [vehicle.LOCATION]]; }  
> > > > > at org.elasticsearch.action. **searc** h.type.\*\*TransportSearchTypeActi  
> > > > > \*\*on$\*\*BaseAsyncAction. **onFirstPhas** eResult(\*\*TransportSearchTypeAct  
> > > > > \*\*ion.\*\*java:259)  
> > > > > at org.elasticsearch.action. **searc** h.type.\*\*TransportSearchTypeActi  
> > > > > \*\*on$\*\*BaseAsyncAction$3.**onFailure(TransportSearchTypeAction.**  
> > > > > java:212)  
> > > > > at org.elasticsearch.search. **actio** n.\*\*SearchServiceTransportAction  
> > > > > \*\*.\*\*sendExecuteQuery( **SearchServic** eTransportAction.\*\*java:143)  
> > > > > at org.elasticsearch.action. **searc** h.type.\*\*TransportSearchQueryThe  
> > > > > **nFetchA** ction$AsyncAction. **sendE** xecuteFirstPhase(\*\*TransportSear  
> > > > > **chQueryThenFetchA** ction.java:\*\*80)  
> > > > > at org.elasticsearch.action. **searc** h.type.\*\*TransportSearchTypeActi  
> > > > > \*\*on$\*\*BaseAsyncAction. **performFirs** tPhase(\*\*TransportSearchTypeActi  
> > > > > \*\*on.\*\*java:204)  
> > > > > at org.elasticsearch.action. **searc** h.type.\*\*TransportSearchTypeActi  
> > > > > \*\*on$\*\*BaseAsyncAction. **performFirs** tPhase(\*\*TransportSearchTypeActi  
> > > > > \*\*on.\*\*java:191)  
> > > > > at org.elasticsearch.action. **searc** h.type.\*\*TransportSearchTypeActi  
> > > > > \*\*on$\*\*BaseAsyncAction$2.run( **Trans** portSearchTypeAction.\*\*java:177)  
> > > > > at java.util.concurrent. **ThreadPoo** lExecutor$Worker.**runTask(**  
> > > > > ThreadPoolExecutor.\*\*java:886)  
> > > > > at java.util.concurrent. **ThreadPoo** lExecutor$Worker.run(\*\*ThreadPoo  
> > > > > \*\*lExecutor.java:908)  
> > > > > at java.lang.Thread.run(Thread. **ja** va:680)
> > > > > 
> > > > > Process finished with exit code 1  
> > > > > Le mardi 1 mai 2012 19:01:28 UTC+2, Frederic Esnault a écrit :
> > > > > 
> > > > > > Hi all  
> > > > > > I'm facing a problem.  
> > > > > > I have documents containing geoloacation data. But when i querya  
> > > > > > gographic query, i get an error, saying 'the 'location' field is not a  
> > > > > > geo\_point type'.
> > > > > > 
> > > > > > I tried to remove my index and create a mapping this way :
> > > > > > 
> > > > > > curl -XPUT '[http://localhost:9200/vo/\*\*vehi\*\*cle/\_mapping](http://localhost:9200/vo/ **vehi** cle/_mapping)[http://localhost:9200/vo/vehicle/\_mapping](http://localhost:9200/vo/vehicle/_mapping)'  
> > > > > > -d ' { "vehicle" : { "properties" : { "LOCATION" : {"type" : "geo\_point"}  
> > > > > > } } } '
> > > > > > 
> > > > > > But the answer was that the index did not exist.
> > > > > > 
> > > > > > So i tried to reindex all my documents then send again my mapping  
> > > > > > query, to let Elasticsearch know that this field is a geo point. But this  
> > > > > > answer was this :  
> > > > > > {"error":" **MergeMappingExceptio** n[Merge failed with failures  
> > > > > > {[Can't merge a non object mapping [LOCATION] with an object mapping  
> > > > > > [LOCATION]]}]","status":400}
> > > > > > 
> > > > > > So what is the way to tell elasticsearch that one of the fields of my  
> > > > > > documents is a geo\_point ?
> > > > > > 
> > > > > > Phoenix

---

<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, 3:29am UTC](https://discuss.elastic.co/t/geolocation-mapping/7526/8 "2017-07-06T03:29:47Z")

</div>


