diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-01-18 09:08:51 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-01-18 09:08:51 +0000 |
commit | 883db822f10d6b03a194583f25dfa1a6b8bf7abe (patch) | |
tree | 6c66e6396d010f7a9740735689eee4812725946c | |
parent | 8ec0e8471f424ead77a335277d86706c4b6d3add (diff) |
Update the index right away if there are only < 10 items
-rw-r--r-- | modules/search/helpers/search_installer.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/search/helpers/search_installer.php b/modules/search/helpers/search_installer.php index ae8eacd3..b823f498 100644 --- a/modules/search/helpers/search_installer.php +++ b/modules/search/helpers/search_installer.php @@ -35,7 +35,13 @@ class search_installer { $db->query("insert into `search_records` (`item_id`) SELECT `id` FROM `items`"); module::set_version("search", 1); - search::check_index(); + if (ORM::factory("search_record")->count_all() < 10) { + foreach (ORM::factory("search_record")->where("dirty", 1)->find_all() as $record) { + search::update_record($record); + } + } else { + search::check_index(); + } } } |