You are here

protected static function SearchApiDbService::getTextFieldName in Search API Database Search 7

Trims long field names to fit into the text table's field_name column.

Parameters

string $name: The field name.

Return value

string The field name as stored in the field_name column.

3 calls to SearchApiDbService::getTextFieldName()
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.

File

./service.inc, line 986
Contains SearchApiDbService.

Class

SearchApiDbService
Indexes and searches items using the database.

Code

protected static function getTextFieldName($name) {
  if (strlen($name) > 255) {

    // Replace long field names with something unique and predictable.
    return drupal_hash_base64($name);
  }
  else {
    return $name;
  }
}