diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-07-28 20:32:21 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-07-28 20:32:21 +0000 |
commit | cd632f62510bb78a619cb40a316478ca47ca5249 (patch) | |
tree | 1ce833676637417824dddb86abb80741fcd2fa30 /modules | |
parent | 4c630e8fe6665fb2cf04813190a0a0570e110f64 (diff) | |
download | brdo-cd632f62510bb78a619cb40a316478ca47ca5249.tar.gz brdo-cd632f62510bb78a619cb40a316478ca47ca5249.tar.bz2 |
- Alternative fix for search module bug.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/search.module | 6 | ||||
-rw-r--r-- | modules/search/search.module | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/modules/search.module b/modules/search.module index a0c6ff81e..ef71e9493 100644 --- a/modules/search.module +++ b/modules/search.module @@ -279,7 +279,7 @@ function update_index($search_array) { // Walk through the array, giving a "weight" to each word based on // the number of times it appears in a page. foreach ($eachword as $word) { - if (strlen($word) >= $minimum_word_size) { + if (strlen($word) >= $minimum_word_size && strlen($word) <= 50) { if ($newwords[$word]) { $newwords[$word]++; } @@ -293,9 +293,7 @@ function update_index($search_array) { // the search index. if ($newwords) { foreach ($newwords as $key => $value) { - if (strlen($key) <= 50) { - db_query("INSERT INTO {search_index} VALUES('%s', %d, '%s', %d)", $key, $node['lno'], $node_type, $value); - } + db_query("INSERT INTO {search_index} VALUES('%s', %d, '%s', %d)", $key, $node['lno'], $node_type, $value); } } diff --git a/modules/search/search.module b/modules/search/search.module index a0c6ff81e..ef71e9493 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -279,7 +279,7 @@ function update_index($search_array) { // Walk through the array, giving a "weight" to each word based on // the number of times it appears in a page. foreach ($eachword as $word) { - if (strlen($word) >= $minimum_word_size) { + if (strlen($word) >= $minimum_word_size && strlen($word) <= 50) { if ($newwords[$word]) { $newwords[$word]++; } @@ -293,9 +293,7 @@ function update_index($search_array) { // the search index. if ($newwords) { foreach ($newwords as $key => $value) { - if (strlen($key) <= 50) { - db_query("INSERT INTO {search_index} VALUES('%s', %d, '%s', %d)", $key, $node['lno'], $node_type, $value); - } + db_query("INSERT INTO {search_index} VALUES('%s', %d, '%s', %d)", $key, $node['lno'], $node_type, $value); } } |