/** * {@inheritdoc} */ public function getQueryTypesForFacet(FacetInterface $facet) { // Get our Facets Field Identifier, which is equal to the Search API Field // identifier. $field_id = $facet->getFieldIdentifier(); // Get the Search API Server. $server = $this->index->getServerInstance(); // Get the Search API Backend. $backend = $server->getBackend(); $fields = $this->index->getFields(); foreach ($fields as $field) { if ($field->getFieldIdentifier() == $field_id) { return $this->getQueryTypesForDataType($backend, $field->getType()); } } throw new InvalidQueryTypeException($this->t("No available query types were found for facet @facet", ['@facet' => $facet->getName()])); }