/** * {@inheritdoc} */ public function setFulltextFields(array $fields = NULL) { $fulltext_fields = $this->index->getFulltextFields(); foreach (array_diff($fields, $fulltext_fields) as $field_id) { throw new SearchApiException(new FormattableMarkup('Trying to search on field @field which is no indexed fulltext field.', array('@field' => $field_id))); } $this->fields = $fields; return $this; }
/** * {@inheritdoc} */ public function preExecute() { // Make sure to only execute this once per query. if (!$this->preExecuteRan) { $this->preExecuteRan = TRUE; // Add fulltext fields, unless set if ($this->fields === NULL) { $this->fields = $this->index->getFulltextFields(); } // Preprocess query. $this->index->preprocessSearchQuery($this); // Let modules alter the query. \Drupal::moduleHandler()->alter('search_api_query', $this); } }
/** * {@inheritdoc} */ public function getFulltextFields() { return $this->entity->getFulltextFields(); }