search_index_split

  1. drupal
    1. 5
    2. 8
    3. 6
    4. 7
Versions
5 – 6 search_index_split($text)

Simplifies and splits a string into tokens for indexing.

▾ 1 function calls search_index_split()

search_index in modules/search/search.module
Update the full-text search index for a particular item.

Code

modules/search/search.module, line 504

<?php
function search_index_split($text) {
  $last = &drupal_static(__FUNCTION__);
  $lastsplit = &drupal_static(__FUNCTION__ . ':lastsplit');

  if ($last == $text) {
    return $lastsplit;
  }
  // Process words
  $text = search_simplify($text);
  $words = explode(' ', $text);

  // Save last keyword result
  $last = $text;
  $lastsplit = $words;

  return $words;
}
?>