2016-11-24 5 views

Antwort

2

Sie benötigen einen geo_shape Abfrage wie diese verwenden:.

{ 
    "query": { 
    "bool": { 
     "filter": { 
     "geo_shape": { 
      "location": { 
      "shape": { 
       "type": "point", 
       "coordinates": [ -77.03653, 38.897676 ] <-- lon/lat to search 
      }, 
      "relation": "contains"      <-- use the contains relationship 
      } 
     } 
     } 
    } 
    } 
} 

im coordinates Parameter stellen Sie sicher, Länge vor Breite einzustellen und nicht umgekehrt (t hanks GeoJSON)

+0

Konnten Sie das ausprobieren? – Val

+0

Probieren Sie es aus. Sie können "relation": "contains" entfernen, da es standardmäßig "intersects" ist. Für eine Punktabfrage funktioniert der Standard. – samol

+0

Gotcha, froh, dass es geholfen hat! – Val

Verwandte Themen