diff --git a/lib/Byng/Pimcore/Elasticsearch/Gateway/AbstractGateway.php b/lib/Byng/Pimcore/Elasticsearch/Gateway/AbstractGateway.php index d24a7b8..0815f7f 100644 --- a/lib/Byng/Pimcore/Elasticsearch/Gateway/AbstractGateway.php +++ b/lib/Byng/Pimcore/Elasticsearch/Gateway/AbstractGateway.php @@ -187,6 +187,13 @@ protected function processQuery(QueryInterface $query) ]; break; + case "ids": + $result["ids"] = [ + "type" => $query->getIndexType(), + "values" => $query->getValues() + ]; + break; + case "prefix": $result["prefix"] = [ $query->getField() => $query->getQuery() diff --git a/lib/Byng/Pimcore/Elasticsearch/Query/IdsQuery.php b/lib/Byng/Pimcore/Elasticsearch/Query/IdsQuery.php new file mode 100644 index 0000000..0c2d5b6 --- /dev/null +++ b/lib/Byng/Pimcore/Elasticsearch/Query/IdsQuery.php @@ -0,0 +1,75 @@ + + */ +final class IdsQuery implements QueryInterface +{ + /** + * @var string + */ + private $indexType; + + /** + * @var array + */ + private $values; + + /** + * IdsQuery constructor. + * + * @param string $indexType + * @param array $values + */ + public function __construct($indexType, array $values) + { + $this->indexType = $indexType; + $this->values = $values; + } + + /** + * Get type + * + * @return string + */ + public function getIndexType() + { + return $this->indexType; + } + + /** + * Get values + * + * @return array + */ + public function getValues() + { + return $this->values; + } + + /** + * {@inheritdoc} + */ + public function getType() + { + return "ids"; + } + +} diff --git a/lib/Byng/Pimcore/Elasticsearch/Query/QueryBuilder.php b/lib/Byng/Pimcore/Elasticsearch/Query/QueryBuilder.php index 6f8f654..692d9c7 100644 --- a/lib/Byng/Pimcore/Elasticsearch/Query/QueryBuilder.php +++ b/lib/Byng/Pimcore/Elasticsearch/Query/QueryBuilder.php @@ -262,6 +262,13 @@ protected function processQuery(QueryInterface $query) ]; break; + case "ids": + $result["ids"] = [ + "type" => $query->getIndexType(), + "values" => $query->getValues() + ]; + break; + case "prefix": $result["prefix"] = [ $query->getField() => $query->getQuery()