You are here

protected function SearchApiTokenizer::process in Search API 7

Function that is ultimately called for all text by the standard implementation, and does nothing by default.

Parameters

$value: The value to preprocess as a string. Can be manipulated directly, nothing has to be returned. Since this can be called for all value types, $value has to remain a string.

Overrides SearchApiAbstractProcessor::process

File

includes/processor_tokenizer.inc, line 94
Contains SearchApiTokenizer.

Class

SearchApiTokenizer
Processor for tokenizing fulltext data by replacing (configurable) non-letters with spaces.

Code

protected function process(&$value) {

  // We don't touch integers, NULL values or the like.
  if (is_string($value)) {
    $this
      ->prepare();
    if ($this->ignorable) {
      $value = preg_replace('/' . $this->ignorable . '+/u', '', $value);
    }
    if ($this->spaces) {
      $value = preg_replace('/' . $this->spaces . '+/u', ' ', $value);
    }
  }
}