/** * {inheritDoc} */ public function set_granular_type_restrictions(array $restrictions) { $clauses = array(); foreach ($restrictions as $search_type => $contrib_types) { if (empty($contrib_types)) { continue; } $clauses[] = $this->query->lAnd($this->query->eq('type', $search_type), $this->in_set('parent_contrib_type', $contrib_types)); } $this->query->where($this->query->lOr($clauses)); return $this; }
/** * Builds the search query and returns the parsed response * * @param ezcSearchFindQuery $query * @return ezcSearchResult */ public function find(ezcSearchFindQuery $query) { $queryWord = join(' AND ', $query->whereClauses); $resultFieldList = $query->resultFields; $highlightFieldList = $query->highlightFields; $facetFieldList = $query->facets; $limit = $query->limit; $offset = $query->offset; $order = $query->orderByClauses; $res = $this->search($queryWord, '', array(), $resultFieldList, $highlightFieldList, $facetFieldList, $limit, $offset, $order); return $this->createResponseFromData($query->getDefinition(), $res); }