function search_index_split in Drupal 4
Same name and namespace in other branches
- 8 core/modules/search/search.module \search_index_split()
- 5 modules/search/search.module \search_index_split()
- 6 modules/search/search.module \search_index_split()
- 7 modules/search/search.module \search_index_split()
- 9 core/modules/search/search.module \search_index_split()
Splits a string into tokens for indexing.
1 call to search_index_split()
- search_index in modules/
search.module - Update the full-text search index for a particular item.
File
- modules/
search.module, line 398 - Enables site-wide keyword searching.
Code
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;
}