diff --git a/modules/search.module b/modules/search.module index 0f7e1434dfb364de7930dbefaec80c0bfe782948..e3fbb9dfbfe5d460ec9529b755a3dbd4db15b48d 100644 --- a/modules/search.module +++ b/modules/search.module @@ -262,8 +262,10 @@ function update_index($search_array) { ** Walk through the weighted words array, inserting them into ** the search index */ - foreach ($newwords as $key => $value) { - db_query("INSERT INTO search_index VALUES('$key', ". $node["lno"] .", '$node_type', $value)"); + if ($newwords) { + foreach ($newwords as $key => $value) { + db_query("INSERT INTO search_index VALUES('$key', ". $node["lno"] .", '$node_type', $value)"); + } } // Zap the weighted words array, so we don't add multiples.