Skip to content
This repository was archived by the owner on Nov 4, 2021. It is now read-only.

Commit fe5a2fe

Browse files
authored
Merge pull request #86 from Anatoliy-Gerasimov/master
support of Geo Shapes
2 parents 9bd8fd1 + d28c306 commit fe5a2fe

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/Builders/FilterBuilder.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,27 @@ public function whereGeoPolygon($field, array $points)
343343

344344
return $this;
345345
}
346+
347+
/**
348+
* @see https://www.elastic.co/guide/en/elasticsearch/guide/current/querying-geo-shapes.html Querying Geo Shapes
349+
*
350+
* @param string $field
351+
* @param array $shape
352+
* @return $this
353+
*/
354+
public function whereGeoShape($field, array $shape)
355+
{
356+
$this->wheres['must'][] = [
357+
'geo_shape' => [
358+
$field => [
359+
'shape' => $shape
360+
]
361+
]
362+
];
346363

364+
return $this;
365+
}
366+
347367
/**
348368
* @param string $field
349369
* @param string $direction

0 commit comments

Comments
 (0)