Skip to content

Commit

Permalink
Merge pull request #24 from byng-systems/master_terms_query
Browse files Browse the repository at this point in the history
Update plugin to support terms query
  • Loading branch information
IoannisByng authored Jul 8, 2016
2 parents 94d65e2 + 2fec1fd commit 78b6f05
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/Byng/Pimcore/Elasticsearch/Gateway/AbstractGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ protected function doSearch(
/**
* Process a query into an array usable by Elasticsearch
*
* @param Query $query
* @param QueryInterface $query
*
* @return array
*/
Expand Down Expand Up @@ -175,6 +175,12 @@ protected function processQuery(QueryInterface $query)
$result[$column]["order"] = $order;
}
break;

case "terms":
$result["constant_score"]["filter"]["terms"] = [
$query->getField() => $query->getTerms()
];
break;

default:
throw new \InvalidArgumentException(sprintf(
Expand Down
2 changes: 1 addition & 1 deletion lib/Byng/Pimcore/Elasticsearch/Query/TermsQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* @author Asim Liaquat <[email protected]>
*/
final class TermsQuery implements Query
final class TermsQuery implements QueryInterface
{
/**
* @var string
Expand Down

0 comments on commit 78b6f05

Please sign in to comment.