You are here

public function SearchApiPage::getFulltextFields in Search API Pages 8

File

src/Entity/SearchApiPage.php, line 187

Class

SearchApiPage
Defines the Search page entity.

Namespace

Drupal\search_api_page\Entity

Code

public function getFulltextFields() {
  if (empty($this->index)) {
    return [];
  }

  /* @var  $index \Drupal\search_api\IndexInterface */
  $index = Index::load($this->index);
  $fields = [];
  $fields_info = $index
    ->getFields();
  foreach ($index
    ->getFulltextFields() as $field_id) {
    $fields[$field_id] = $fields_info[$field_id]
      ->getPrefixedLabel();
  }
  return $fields;
}