Geolocation mapping


(phoenix) #1

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' -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


(phoenix) #2

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 [:slight_smile:
򃦲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 [:slight_smile:
򃦲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' -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


(Igor Motov) #3

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'
curl -XPUT 'http://localhost:9200/vo'
curl -XPUT '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 [:slight_smile:
򃦲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 [:slight_smile:
򃦲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' -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


(phoenix) #4

Thx, I'll try this tonight.
Frederic
Le 2 mai 2012 05:58, "Igor Motov" 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'
curl -XPUT 'http://localhost:9200/vo'
curl -XPUT '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 [:slight_smile:
򃦲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 [:slight_smile:
򃦲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.
TransportSearchQueryThenFetchA
ction$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/_mappinghttp://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


(phoenix) #5

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'
curl -XPUT 'http://localhost:9200/vo'
curl -XPUT '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 [:slight_smile:
򃦲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 [:slight_smile:
򃦲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.
TransportSearchQueryThenFetchA
ction$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/_mappinghttp://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


(phoenix) #6

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'
curl -XPUT 'http://localhost:9200/vo'
curl -XPUT '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 [:slight_smile:
򃦲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 [:slight_smile:
򃦲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.
TransportSearchQueryThenFetchA
ction$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/_mappinghttp://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


(Shay Banon) #7

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> 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'
curl -XPUT 'http://localhost:9200/vo'
curl -XPUT 'http://localhost:9200/vo/**vehicle/_mappinghttp://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 [:slight_smile:
򃦲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 [:slight_smile:
򃦲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.**TransportSearchTypeActi
**on$**BaseAsyncAction.onFirstPhaseResult(**TransportSearchTypeAct
**ion.**java:259)
at org.elasticsearch.action.search.type.**TransportSearchTypeActi
**on$**BaseAsyncAction$3.onFailure(TransportSearchTypeAction.
java:212)
at org.elasticsearch.search.action.**SearchServiceTransportAction
**.**sendExecuteQuery(SearchServiceTransportAction.**java:143)
at org.elasticsearch.action.search.type.**TransportSearchQueryThe
nFetchAction$AsyncAction.sendExecuteFirstPhase(**TransportSear
chQueryThenFetchAction.java:**80)
at org.elasticsearch.action.search.type.**TransportSearchTypeActi
**on$**BaseAsyncAction.performFirstPhase(**TransportSearchTypeActi
**on.**java:204)
at org.elasticsearch.action.search.type.**TransportSearchTypeActi
**on$**BaseAsyncAction.performFirstPhase(**TransportSearchTypeActi
**on.**java:191)
at org.elasticsearch.action.search.type.**TransportSearchTypeActi
**on$**BaseAsyncAction$2.run(TransportSearchTypeAction.**java:177)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
ThreadPoolExecutor.**java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(**ThreadPoo
**lExecutor.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/_mappinghttp://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


(system) #8