mirror of
https://github.com/Codappix/search_core.git
synced 2024-11-22 15:36:12 +01:00
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:
parent
f5729c2763
commit
f4a9531fe5
1 changed files with 1 additions and 7 deletions
|
@ -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]);
|
||||
|
|
Loading…
Reference in a new issue