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Ԅquerylteredmatch_allfiltero_distancehicle.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Ԅquerylteredmatch_allfiltero_distancehicle.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 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