search_index_split

Versions
4.7 – 7
search_index_split($text)

Splits a string into tokens for indexing.

▾ 1 function calls search_index_split()

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

Code

modules/search.module, line 398

<?php
function search_index_split($text) {
  static $last = null;
  static $lastsplit = null;

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

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

  return $words;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.