mirror of
https://github.com/Codappix/search_core.git
synced 2024-11-25 21:56:11 +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()) {
|
if ($searchRequest->hasFilter()) {
|
||||||
foreach ($searchRequest->getFilter() as $field => $value) {
|
$query['bool']['filter'] = ['term' => $searchRequest->getFilter()];
|
||||||
$queryFilter[$field] = $value;
|
|
||||||
}
|
|
||||||
$query['bool']['filter'] = [
|
|
||||||
'term' => $queryFilter,
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new \Elastica\Query(['query' => $query]);
|
return new \Elastica\Query(['query' => $query]);
|
||||||
|
|
Loading…
Reference in a new issue