You are here

function search_api_is_text_type in Search API 7

Determines whether a field of the given type contains text data.

Can also be used to find other types.

Parameters

string $type: The type for which to check.

array $allowed: Optionally, an array of allowed types.

Return value

bool TRUE if $type is either one of the specified types or a list of such values. FALSE otherwise.

See also

search_api_extract_inner_type()

7 calls to search_api_is_text_type()
SearchApiAbstractProcessor::testType in includes/processor.inc
Determines whether fields of the given type should normally be processed.
SearchApiIndex::getFulltextFields in includes/index_entity.inc
Convenience method for getting all of this index's fulltext fields.
SearchApiQuery::sort in includes/query.inc
Adds a sort directive to this search query.
SearchApiTokenizer::configurationForm in includes/processor_tokenizer.inc
Display a form for configuring this processor. Since forcing users to specify options for disabled processors makes no sense, none of the form elements should have the '#required' attribute set.
search_api_admin_index_workflow_submit in ./search_api.admin.inc
Form submission handler for search_api_admin_index_workflow().

... See full list

File

./search_api.module, line 2328
Provides a flexible framework for implementing search services.

Code

function search_api_is_text_type($type, array $allowed = array(
  'text',
)) {
  return array_search(search_api_extract_inner_type($type), $allowed) !== FALSE;
}