|
14 | 14 | use Elastica\Query\Exists;
|
15 | 15 | use Elastica\Query\FunctionScore;
|
16 | 16 | use Elastica\Query\Fuzzy;
|
| 17 | +use Elastica\Query\GeoBoundingBox; |
17 | 18 | use Elastica\Query\GeoDistance;
|
| 19 | +use Elastica\Query\GeoPolygon; |
18 | 20 | use Elastica\Query\HasChild;
|
19 | 21 | use Elastica\Query\HasParent;
|
20 | 22 | use Elastica\Query\Ids;
|
21 | 23 | use Elastica\Query\Match;
|
22 | 24 | use Elastica\Query\MatchAll;
|
23 | 25 | use Elastica\Query\MatchNone;
|
| 26 | +use Elastica\Query\MatchPhrase; |
| 27 | +use Elastica\Query\MatchPhrasePrefix; |
24 | 28 | use Elastica\Query\MoreLikeThis;
|
25 | 29 | use Elastica\Query\MultiMatch;
|
26 | 30 | use Elastica\Query\Nested;
|
@@ -159,6 +163,38 @@ public function fuzzy(string $fieldName = null, string $value = null): Fuzzy
|
159 | 163 | return new Fuzzy($fieldName, $value);
|
160 | 164 | }
|
161 | 165 |
|
| 166 | + /** |
| 167 | + * geo bounding box query. |
| 168 | + * |
| 169 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-bounding-box-query.html |
| 170 | + */ |
| 171 | + public function geo_bounding_box(string $key, array $coordinates): GeoBoundingBox |
| 172 | + { |
| 173 | + return new GeoBoundingBox($key, $coordinates); |
| 174 | + } |
| 175 | + |
| 176 | + /** |
| 177 | + * geo distance query. |
| 178 | + * |
| 179 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-distance-query.html |
| 180 | + * |
| 181 | + * @param array|string $location |
| 182 | + */ |
| 183 | + public function geo_distance(string $key, $location, string $distance): GeoDistance |
| 184 | + { |
| 185 | + return new GeoDistance($key, $location, $distance); |
| 186 | + } |
| 187 | + |
| 188 | + /** |
| 189 | + * geo polygon query. |
| 190 | + * |
| 191 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-polygon-query.html |
| 192 | + */ |
| 193 | + public function geo_polygon(string $key, array $points): GeoPolygon |
| 194 | + { |
| 195 | + return new GeoPolygon($key, $points); |
| 196 | + } |
| 197 | + |
162 | 198 | /**
|
163 | 199 | * geo shape query.
|
164 | 200 | *
|
@@ -225,6 +261,26 @@ public function match_none(): MatchNone
|
225 | 261 | return new MatchNone();
|
226 | 262 | }
|
227 | 263 |
|
| 264 | + /** |
| 265 | + * match phrase query. |
| 266 | + * |
| 267 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query-phrase.html |
| 268 | + */ |
| 269 | + public function match_phrase(string $field = null, $values = null): MatchPhrase |
| 270 | + { |
| 271 | + return new MatchPhrase($field, $values); |
| 272 | + } |
| 273 | + |
| 274 | + /** |
| 275 | + * match phrase prefix query. |
| 276 | + * |
| 277 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query-phrase-prefix.html |
| 278 | + */ |
| 279 | + public function match_phrase_prefix(string $field = null, $values = null): MatchPhrasePrefix |
| 280 | + { |
| 281 | + return new MatchPhrasePrefix($field, $values); |
| 282 | + } |
| 283 | + |
228 | 284 | /**
|
229 | 285 | * more like this query.
|
230 | 286 | *
|
@@ -432,18 +488,6 @@ public function wildcard(string $key = '', string $value = null, float $boost =
|
432 | 488 | return new Wildcard($key, $value, $boost);
|
433 | 489 | }
|
434 | 490 |
|
435 |
| - /** |
436 |
| - * geo distance query. |
437 |
| - * |
438 |
| - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-distance-query.html |
439 |
| - * |
440 |
| - * @param array|string $location |
441 |
| - */ |
442 |
| - public function geo_distance(string $key, $location, string $distance): GeoDistance |
443 |
| - { |
444 |
| - return new GeoDistance($key, $location, $distance); |
445 |
| - } |
446 |
| - |
447 | 491 | /**
|
448 | 492 | * exists query.
|
449 | 493 | *
|
|
0 commit comments