Skip to content
Snippets Groups Projects
Commit 6905a9a2 authored by Mantas Varatiejus's avatar Mantas Varatiejus
Browse files

Merge branch 'martiis-bugfix_multiple_exec' into 1.x

parents cd19f60f 2cf2321f
No related branches found
No related tags found
No related merge requests found
...@@ -37,20 +37,24 @@ class QueryEndpoint extends AbstractSearchEndpoint implements OrderedNormalizerI ...@@ -37,20 +37,24 @@ class QueryEndpoint extends AbstractSearchEndpoint implements OrderedNormalizerI
*/ */
public function normalize(NormalizerInterface $normalizer, $format = null, array $context = []) public function normalize(NormalizerInterface $normalizer, $format = null, array $context = [])
{ {
$query = $this->getBool();
if ($this->hasReference('filtered_query')) { if ($this->hasReference('filtered_query')) {
/** @var FilteredQuery $filteredQuery */ /** @var FilteredQuery $filteredQuery */
$filteredQuery = $this->getReference('filtered_query'); $filteredQuery = $this->getReference('filtered_query');
$this->add($filteredQuery);
if ($query) {
$filteredQuery->setQuery($query);
}
$query = $filteredQuery;
} }
if (!$this->bool) { if (!$query) {
return null; return null;
} }
$queryArray = $this->bool->toArray(); return [$query->getType() => $query->toArray()];
$queryArray = [$this->bool->getType() => $queryArray];
return $queryArray;
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment