You are here

protected function SearchApiDbService::getFieldInfo in Search API Database Search 7

Retrieves the internal field information.

Parameters

SearchApiIndex $index: The index whose fields should be retrieved.

Return value

array $fields An array of arrays. The outer array is keyed by field name. Each value is an associative array with information on the field.

4 calls to SearchApiDbService::getFieldInfo()
SearchApiDbService::getAutocompleteSuggestions in ./service.inc
Implements SearchApiAutocompleteInterface::getAutocompleteSuggestions().
SearchApiDbService::getFacets in ./service.inc
Computes facets for a search query.
SearchApiDbService::indexItem in ./service.inc
Indexes a single item on the specified index.
SearchApiDbService::search in ./service.inc
Executes a search on the server represented by this object.

File

./service.inc, line 2282
Contains SearchApiDbService.

Class

SearchApiDbService
Indexes and searches items using the database.

Code

protected function getFieldInfo(SearchApiIndex $index) {
  $fields = $this->options['indexes'][$index->machine_name];
  foreach ($fields as $key => $field) {

    // Legacy fields do not have column set.
    if (!isset($field['column'])) {
      $fields[$key]['column'] = search_api_is_text_type($field['type']) ? 'word' : 'value';
    }
  }
  return $fields;
}