You are here

protected function FieldsProcessorPluginBase::testType in Search API 8

Determines whether a field of a certain type should be preprocessed.

The default implementation returns TRUE for "text" and "string".

Parameters

string $type: The type of the field (either when preprocessing the field at index time, or a condition on the field at query time).

Return value

bool TRUE if fields of that type should be processed, FALSE otherwise.

4 calls to FieldsProcessorPluginBase::testType()
FieldsProcessorPluginBase::buildConfigurationForm in src/Processor/FieldsProcessorPluginBase.php
Form constructor.
FieldsProcessorPluginBase::preIndexSave in src/Processor/FieldsProcessorPluginBase.php
Preprocesses the search index entity before it is saved.
FieldsProcessorPluginBase::testField in src/Processor/FieldsProcessorPluginBase.php
Tests whether a certain field should be processed.
TestFieldsProcessorPlugin::testType in tests/src/Unit/Processor/TestFieldsProcessorPlugin.php
Determines whether a field of a certain type should be preprocessed.
4 methods override FieldsProcessorPluginBase::testType()
Stemmer::testType in src/Plugin/search_api/processor/Stemmer.php
Determines whether a field of a certain type should be preprocessed.
Stopwords::testType in src/Plugin/search_api/processor/Stopwords.php
Determines whether a field of a certain type should be preprocessed.
TestFieldsProcessorPlugin::testType in tests/src/Unit/Processor/TestFieldsProcessorPlugin.php
Determines whether a field of a certain type should be preprocessed.
Tokenizer::testType in src/Plugin/search_api/processor/Tokenizer.php
Determines whether a field of a certain type should be preprocessed.

File

src/Processor/FieldsProcessorPluginBase.php, line 491

Class

FieldsProcessorPluginBase
Provides a base class for processors that work on individual fields.

Namespace

Drupal\search_api\Processor

Code

protected function testType($type) {
  return $this
    ->getDataTypeHelper()
    ->isTextType($type, [
    'text',
    'string',
  ]);
}