GeoLocation distance search across types


(Dharm0us) #1

I have two types in my city index - zoo and hotel. How do I find all zoos having a hotel in 1KM radius? Here is the mapping of my index :

GET /city/_mapping
{
   "city": {
      "mappings": {
         "hotel": {
            "properties": {
               "location": {
                  "type": "geo_point"
               },
               "name": {
                  "type": "string"
               }
            }
         },
         "zoo": {
            "properties": {
               "location": {
                  "type": "geo_point"
               },
               "name": {
                  "type": "string"
               }
            }
         }
      }
   }
}

(system) #2