You are here

public function SearchApiIndex::getFulltextFields in Search API 7

Convenience method for getting all of this index's fulltext fields.

Parameters

boolean $only_indexed: If set to TRUE, only the indexed fulltext fields will be returned.

Return value

array An array containing all (or all indexed) fulltext fields defined for this index.

File

includes/index_entity.inc, line 935
Contains SearchApiIndex.

Class

SearchApiIndex
Class representing a search index.

Code

public function getFulltextFields($only_indexed = TRUE) {
  $i = $only_indexed ? 1 : 0;
  if (!isset($this->fulltext_fields[$i])) {
    $this->fulltext_fields[$i] = array();
    if ($only_indexed) {
      $fields = isset($this->options['fields']) ? $this->options['fields'] : array();
    }
    else {
      $fields = $this
        ->getFields(FALSE);
    }
    foreach ($fields as $key => $field) {
      if (search_api_is_text_type($field['type'])) {
        $this->fulltext_fields[$i][] = $key;
      }
    }
  }
  return $this->fulltext_fields[$i];
}