public function getSearchQuery()
{
$queryParams = [];
$aggregator = $this->getAggregator();
$value = (bool) $this->getValue();
$queryClause = $aggregator === 'all' ? 'must' : 'should';
foreach ($this->getConditions() as $condition) {
$subQuery = $condition->getSearchQuery();
if ($subQuery !== null && $subQuery instanceof QueryInterface) {
if ($value === false) {
$subQuery = $this->queryFactory->create(QueryInterface::TYPE_NOT, ['query' => $subQuery]);
}
$queryParams[$queryClause][] = $subQuery;
}
}
$query = $this->queryFactory->create(QueryInterface::TYPE_BOOL, $queryParams);
return $query;
}