コード例 #1
0
ファイル: Query.php プロジェクト: jkyto/agolf
 /**
  * {@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;
 }
コード例 #2
0
 /**
  * {@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);
     }
 }
コード例 #3
0
 /**
  * {@inheritdoc}
  */
 public function getFulltextFields()
 {
     return $this->entity->getFulltextFields();
 }