$total=db_result(db_query('SELECT COUNT(*) FROM {node} WHERE status = 1 AND moderate = 0'));
$remaining=db_result(db_query('SELECT COUNT(*) FROM {node} n LEFT JOIN {node_comment_statistics} c ON n.nid = c.nid WHERE n.status = 1 AND n.moderate = 0 AND (n.created > %d OR n.changed > %d OR c.last_comment_timestamp > %d) ORDER BY GREATEST(n.created, n.changed, c.last_comment_timestamp) ASC',$last,$last,$last));
$find=do_search($keys,'node','INNER JOIN {node} n ON n.nid = i.sid '.node_access_join_sql().' INNER JOIN {users} u ON n.uid = u.uid','n.status = 1 AND '.node_access_where_sql());
$total=db_result(db_query('SELECT COUNT(*) FROM {node} WHERE status = 1 AND moderate = 0'));
$remaining=db_result(db_query('SELECT COUNT(*) FROM {node} n LEFT JOIN {node_comment_statistics} c ON n.nid = c.nid WHERE n.status = 1 AND n.moderate = 0 AND (n.created > %d OR n.changed > %d OR c.last_comment_timestamp > %d) ORDER BY GREATEST(n.created, n.changed, c.last_comment_timestamp) ASC',$last,$last,$last));
$find=do_search($keys,'node','INNER JOIN {node} n ON n.nid = i.sid '.node_access_join_sql().' INNER JOIN {users} u ON n.uid = u.uid','n.status = 1 AND '.node_access_where_sql());
@@ -51,8 +51,8 @@ function search_help($section = 'admin/help#search') {
returnt('Enables site-wide keyword searching.');
case'admin/settings/search':
returnt('
<p>The search engine works by maintaining an index of the words in your site\'s content. You can adjust the settings below to tweak the indexing behaviour. Note that the search requires cron to be set up correctly.</p>
<p>Changes to these settings will only apply to content that is indexed after the change. If you want them to apply to everything, you need to wipe the index with the button below.</p>');
<p>The search engine works by maintaining an index of the words in your site\'s content. You can adjust the settings below to tweak the indexing behaviour.</p>
');
case'search#noresults':
returnt('<p><ul>
<li>Check if your spelling is correct.</li>
...
...
@@ -104,28 +104,41 @@ function search_menu($may_cache) {
*/
functionsearch_admin(){
if($_POST){
system_settings_save();
}
if($_POST['op']==t('Wipe index')){
search_wipe();
drupal_set_message(t('The search index has been wiped.'));
$status='<p><strong>'.t('%percentage of the site has been indexed. There are %count items left to index.',array('%percentage'=>$percentage,'%count'=>$remaining)).'</strong></p>';
$group=form_select(t('Items to index per cron run'),'search_cron_limit',variable_get('search_cron_limit',100),$items,t('The maximum amount of items that will be indexed in one cron run. Set this number lower if your cron is timing out or if PHP is running out of memory.'));
$group=form_textfield(t('Minimum word length to index'),'minimum_word_size',variable_get('minimum_word_size',3),3,3,t('The number of characters a word has to be to be indexed. Words shorter than this will not be searchable.'));
$group='<em>'.t('<p>Changing the settings below will cause the site index to be rebuilt. The search index is not cleared but systematically updated to reflect the new settings. Searching will continue to work but new content won\'t be indexed until all existing content has been re-indexed.</p><p>The default settings should be appropriate for the majority of sites.</p>').'</em>';
$group.=form_textfield(t('Minimum word length to index'),'minimum_word_size',variable_get('minimum_word_size',3),3,3,t('The number of characters a word has to be to be indexed. Words shorter than this will not be searchable.'));
$group.=form_textfield(t('Minimum word length to search for'),'remove_short',variable_get('remove_short',3),3,3,t('The number of characters a word has to be to be searched for, including wildcard characters.'));
$group.=form_select(t('Items to index per cron run'),'search_cron_limit',variable_get('search_cron_limit',100),$items,t('The maximum amount of items that will be indexed in one cron run. Set this number lower if your cron is timing out or if PHP is running out of memory.'));
@@ -51,8 +51,8 @@ function search_help($section = 'admin/help#search') {
returnt('Enables site-wide keyword searching.');
case'admin/settings/search':
returnt('
<p>The search engine works by maintaining an index of the words in your site\'s content. You can adjust the settings below to tweak the indexing behaviour. Note that the search requires cron to be set up correctly.</p>
<p>Changes to these settings will only apply to content that is indexed after the change. If you want them to apply to everything, you need to wipe the index with the button below.</p>');
<p>The search engine works by maintaining an index of the words in your site\'s content. You can adjust the settings below to tweak the indexing behaviour.</p>
');
case'search#noresults':
returnt('<p><ul>
<li>Check if your spelling is correct.</li>
...
...
@@ -104,28 +104,41 @@ function search_menu($may_cache) {
*/
functionsearch_admin(){
if($_POST){
system_settings_save();
}
if($_POST['op']==t('Wipe index')){
search_wipe();
drupal_set_message(t('The search index has been wiped.'));
$status='<p><strong>'.t('%percentage of the site has been indexed. There are %count items left to index.',array('%percentage'=>$percentage,'%count'=>$remaining)).'</strong></p>';
$group=form_select(t('Items to index per cron run'),'search_cron_limit',variable_get('search_cron_limit',100),$items,t('The maximum amount of items that will be indexed in one cron run. Set this number lower if your cron is timing out or if PHP is running out of memory.'));
$group=form_textfield(t('Minimum word length to index'),'minimum_word_size',variable_get('minimum_word_size',3),3,3,t('The number of characters a word has to be to be indexed. Words shorter than this will not be searchable.'));
$group='<em>'.t('<p>Changing the settings below will cause the site index to be rebuilt. The search index is not cleared but systematically updated to reflect the new settings. Searching will continue to work but new content won\'t be indexed until all existing content has been re-indexed.</p><p>The default settings should be appropriate for the majority of sites.</p>').'</em>';
$group.=form_textfield(t('Minimum word length to index'),'minimum_word_size',variable_get('minimum_word_size',3),3,3,t('The number of characters a word has to be to be indexed. Words shorter than this will not be searchable.'));
$group.=form_textfield(t('Minimum word length to search for'),'remove_short',variable_get('remove_short',3),3,3,t('The number of characters a word has to be to be searched for, including wildcard characters.'));
$group.=form_select(t('Items to index per cron run'),'search_cron_limit',variable_get('search_cron_limit',100),$items,t('The maximum amount of items that will be indexed in one cron run. Set this number lower if your cron is timing out or if PHP is running out of memory.'));