Topic: disabling the search function
Hi,
I would like to know if it is possible to totally disable the search function in punbb. If yes, how?
Thanks,
Ludo,
You are not logged in. Please login or register.
PunBB Forums → Feature requests → disabling the search function
Hi,
I would like to know if it is possible to totally disable the search function in punbb. If yes, how?
Thanks,
Ludo,
Delete search.php
I guess you could set every group so that it's not allowed to search.
Well, deleting the search.php file or setting groups with 'no search allowed' would indeed prevent users from making search. To my mind, just deleting the link 'search.php' would have effect.
But what I would like is more something like an option in punbb which would enable or not to use the search process (I mean the fact that for each post, keywords are put in the DB)
The option would disable keywords generation for each post and so it would avoid having big big DB....
Making that would not bloatify. It would in fact light the punbb forum .
Ludo,
Just comment the lines
update_search_index('post', $new_pid, $message);
in post.php
update_search_index('edit', $id, $message, $subject);
and
update_search_index('edit', $id, $message);
in edit.php
and that should stop indexing
when you say comment, you mean delete?
Then, how could I empty keywords without deleting the table in the whole (in the case I would like, later, to re-use the search function of punbb)
If it is so simple, I think we could easily have an option with the choice of using the search function of punbb or not. It would be a way to disable properly the search function.
that's just a suggestion but it could be a good thing for people who only want to use search with google and its adsense search
Ludo,
Commenting is embracing the code with /* */ or put // in front pf the code
And to clean, I forgot the command =/
Just set "Use search" to no for the user groups.
Just set "Use search" to no for the user groups.
I said that already, and he already said no.
Rickard wrote:Just set "Use search" to no for the user groups.
I said that already, and he already said no.
Sorry. I'm tired
I said that already, and he already said no.
Mmmmm. I did not really say no. I just said it would not empty the search index which is quite heavy in the db.
I don't want to be bloody annoying.
I just made suggestions. You can take it or not, it will not anoy me
To sum up for Rickard who is tired :
I would like one new feature : an option to totally disable the search function in punbb (empty the search index and delete the link search.php)
Ludo,
Would it be possible to make a basic search without the indexation tables, as you can do with other forums like phpBB?
I also have some database limitations, and having such big tables make me impossible to use PunBB.
Blacklisting words only reduced the tables of 1/3.
Any idea?
Would it be possible to make a basic search without the indexation tables, as you can do with other forums like phpBB?
PunBB's search feature is based on phpBB's
And changing the search function to be the way you want it would be less efficent I believe, even if it does save DB space
Yes, but with a 10MB database limitation, and no way to change of hoster, you have choices to make
With a 10MB limitation you should probably move somewhere else
Only very silly hosts limit databases that much (a lot simply count it against your disk quota or don't count it at all, which is better)
Plus, I doubt your forum can get very large even without the search tables. 10MB is small
i remowe serach link from functions.php and deselect "use search" from all groups ... edited show last post ... becouse i can't include serach.php to my site.. evrything seems to work cool
With a 10MB limitation you should probably move somewhere else
Only very silly hosts limit databases that much (a lot simply count it against your disk quota or don't count it at all, which is better)
I can't change this.
Plus, I doubt your forum can get very large even without the search tables. 10MB is small
With 2100 registred users (and guests allowed to post) this is not a *very* little forum. The problem is that I have to prune it and rebuild search index regulary.
I don't have any specific stats for PunBB, but here's some phpBB ones
http://www.phpbb.com/phpBB/viewtopic.php?t=48609
http://www.phpbb.com/phpBB/viewtopic.php?p=61823
So yeah, it depends a lot on where you have rows (ie: a row in posts is almost certainly larger than a row in users, and a longer post has a larger size). But IMO, 10MB is very small
And why can't you change it? There are plenty of hosts, free or otherwise, that at the VERY least give you more space for your databases than that
In search.php I replaced this
// Are we searching for multibyte charset text?
if ($multibyte)
{
$cur_word = $db->escape('%'.str_replace('*', '', $cur_word).'%');
$cur_word_like = ($db_type == 'pgsql') ? 'ILIKE \''.$cur_word.'\'' : 'LIKE \''.$cur_word.'\'';
if ($search_in > 0)
$sql = 'SELECT id FROM '.$db->prefix.'posts WHERE message '.$cur_word_like;
else if ($search_in < 0)
$sql = 'SELECT p.id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE t.subject '.$cur_word_like.' GROUP BY p.id, t.id';
else
$sql = 'SELECT p.id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE p.message '.$cur_word_like.' OR t.subject '.$cur_word_like.' GROUP BY p.id, t.id';
}
else
{
$cur_word = str_replace('*', '%', $cur_word);
$sql = 'SELECT m.post_id FROM '.$db->prefix.'search_words AS w INNER JOIN '.$db->prefix.'search_matches AS m ON m.word_id = w.id WHERE w.word LIKE \''.$cur_word.'\''.$search_in_cond;
}
By:
// Are we searching for multibyte charset text?
$cur_word = $db->escape('%'.str_replace('*', '', $cur_word).'%');
$cur_word_like = ($db_type == 'pgsql') ? 'ILIKE \''.$cur_word.'\'' : 'LIKE \''.$cur_word.'\'';
if ($search_in > 0)
$sql = 'SELECT id FROM '.$db->prefix.'posts WHERE message '.$cur_word_like;
else if ($search_in < 0)
$sql = 'SELECT p.id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE t.subject '.$cur_word_like.' GROUP BY p.id, t.id';
else
$sql = 'SELECT p.id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE p.message '.$cur_word_like.' OR t.subject '.$cur_word_like.' GROUP BY p.id, t.id';
(In fact I juste replaced "if ($multibyte)" by "if ($multibyte || 1)" to reduce code modifications, and be able to reverse this change easily.)
And I don't use anymore the indexation tables.
This is not a clean solution, and I know that it must be less efficient, or loads the server, but it works.
I also added a 'return;' at the beginning of the 'update_search_index' function, in the 'include/search_idx.php file, so the indexation tables are not fed anymore.
PunBB Forums → Feature requests → disabling the search function
Powered by PunBB, supported by Informer Technologies, Inc.