TASK: Remove unnecessary code

* As filter is already in the format we need, we can just use it instead
  of using a foreach.
This commit is contained in:
Daniel Siepmann 2017-06-06 16:25:35 +02:00
parent f5729c2763
commit f4a9531fe5
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4

View file

@ -56,15 +56,9 @@ class QueryFactory
],
],
];
$queryFilter = [];
if ($searchRequest->hasFilter()) {
foreach ($searchRequest->getFilter() as $field => $value) {
$queryFilter[$field] = $value;
}
$query['bool']['filter'] = [
'term' => $queryFilter,
];
$query['bool']['filter'] = ['term' => $searchRequest->getFilter()];
}
return new \Elastica\Query(['query' => $query]);