See doc: 
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#_geo_distance_sorting

Missing _ I guess

-- 
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr


Le 16 janvier 2014 at 18:21:24, Travis Bullock ([email protected]) a 
écrit:

Hello,

I've set up a mapping on myIndex as follows:

"mappings" : {
        "place" : {
            "properties" : {
                "location" : {
                    "type" : "geo_point",
                    "fielddata" : {
                        "format" : "compressed",
                        "precision" : "3m"
                    }
                }
            }
        }
    }

And indexed data like so:


{"_index":"myIndex","_type":"place","_id":"328","_version":2,"exists":true, 
"_source" : {"location":{"lat":42.02397,"lon":-87.684965}}




When querying I get an error:



{
 "index": "myIndex",
 "size": 10,
 "from": 1,
 "type": "place",
 "filtered": {
  "query": {
   "query_string": "test"
  },
  "bool": {
   "must": [
    {
     "geo_distance": {
      "distance": "150mi",
      "place.location": {
       "lat": "41.8781136",
       "lon": "-87.6297982"
      }
     }
    }
   ]
  }
 },
 "sort": [
  {
   "geo_distance": {
    "location": {
     "lat": "41.8781136",
     "lon": "-87.6297982"
    },
    "unit": "mi",
    "order": "ASC"
   }
  }
 ]
}



The error is "Parse Failure [No mapping found for [[object Object]] in order to 
sort on"


I've tried changing location to place.location in the sort.
Also, should I use "_geo_distance" or "geo_distance"? Why are they both used in 
different documentation?


Thanks!
Travis
--
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/452ec200-001d-4347-b756-6350b281d59c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/etPan.52d81774.4e6afb66.dc5%40MacBook-Air-de-David.local.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to