summaryrefslogtreecommitdiff
path: root/vendor/ruflin/elastica/lib/Elastica/Filter/GeoShapePreIndexed.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-12-18 06:00:00 +0100
committerPierre Schmitz <pierre@archlinux.de>2015-12-18 06:00:00 +0100
commit15e69f7b20b6596b9148030acce5b59993b95a45 (patch)
tree7b828b8920b0e222dc2a2c97dde933c9c4864fab /vendor/ruflin/elastica/lib/Elastica/Filter/GeoShapePreIndexed.php
parent9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff)
Update to MediaWiki 1.25.4
Diffstat (limited to 'vendor/ruflin/elastica/lib/Elastica/Filter/GeoShapePreIndexed.php')
-rw-r--r--vendor/ruflin/elastica/lib/Elastica/Filter/GeoShapePreIndexed.php85
1 files changed, 85 insertions, 0 deletions
diff --git a/vendor/ruflin/elastica/lib/Elastica/Filter/GeoShapePreIndexed.php b/vendor/ruflin/elastica/lib/Elastica/Filter/GeoShapePreIndexed.php
new file mode 100644
index 00000000..7e89f8a8
--- /dev/null
+++ b/vendor/ruflin/elastica/lib/Elastica/Filter/GeoShapePreIndexed.php
@@ -0,0 +1,85 @@
+<?php
+
+namespace Elastica\Filter;
+
+/**
+ * geo_shape filter for pre-indexed shapes
+ *
+ * Filter pre-indexed shape definitions
+ *
+ * @category Xodoa
+ * @package Elastica
+ * @author Bennie Krijger <benniekrijger@gmail.com>
+ * @link http://www.elasticsearch.org/guide/reference/query-dsl/geo-shape-filter/
+ */
+class GeoShapePreIndexed extends AbstractGeoShape
+{
+ /**
+ * elasticsearch id of the pre-indexed shape
+ *
+ * @var string
+ */
+ protected $_indexedId;
+
+ /**
+ * elasticsearch type of the pre-indexed shape
+ *
+ * @var string
+ */
+ protected $_indexedType;
+
+ /**
+ * elasticsearch index of the pre-indexed shape
+ *
+ * @var string
+ */
+ protected $_indexedIndex;
+
+ /**
+ * elasticsearch path/field name of the pre-indexed shape
+ *
+ * @var string
+ */
+ protected $_indexedPath;
+
+ /**
+ * Construct geo_shape filter with a pre-indexed shape
+ *
+ * @param string $path The path/field of the shape searched
+ * @param string $indexedId Id of the pre-indexed shape
+ * @param string $indexedType Type of the pre-indexed shape
+ * @param string $indexedIndex Index of the pre-indexed shape
+ * @param string $indexedPath Path of the pre-indexed shape
+ */
+ public function __construct($path, $indexedId, $indexedType, $indexedIndex, $indexedPath)
+ {
+ $this->_path = $path;
+ $this->_indexedId = $indexedId;
+ $this->_indexedType = $indexedType;
+ $this->_indexedIndex = $indexedIndex;
+ $this->_indexedPath = $indexedPath;
+ }
+
+ /**
+ * Converts filter to array
+ *
+ * @see \Elastica\Filter\AbstractFilter::toArray()
+ * @return array
+ */
+ public function toArray()
+ {
+ return array(
+ 'geo_shape' => array(
+ $this->_path => array(
+ 'indexed_shape' => array(
+ 'id' => $this->_indexedId,
+ 'type' => $this->_indexedType,
+ 'index' => $this->_indexedIndex,
+ 'path' => $this->_indexedPath
+ ),
+ 'relation' => $this->_relation
+ )
+ )
+ );
+ }
+}