Author |
Message |
Quuipo Board Member
Joined: 12 Aug 2009
Posts: 4
|
Posted: Wed Aug 12, 2009 4:32 am Post subject: how to exclude popular search words ? |
|
|
woo! First of all, I have to say I am glad I found your site!
I'm still using phpbb2
I used to have something somewhere that if people search for a popular term, you get a message:"please use a different term" or something like that.
I don't know what it was, and I don't know why it now is gone (maybe with going over to php5.0)
and I would like to have it back!
Does anyone know what I'm talking about and can help me out?
much appreciated
edit: whoops, sorry, I see i posted this in the wrong section |
|
Back to top |
|
|
Jim_UK Board Member
Joined: 19 Nov 2008
Posts: 656 Location: North West UK
|
Posted: Wed Aug 12, 2009 5:10 am Post subject: Re: how to exclude popular search words ? |
|
|
As far as I am aware there is no such message in phpBB2 so perhaps it was a mod that you had.
There is this in the language file
Quote: | Search for any terms or use query as entered | but that is not what you describe.
You can exclude as many words as you want from the search by adding them to the list in the file
language/lang_english/search_stopwords.txt
Jim _________________ The truth is out there.
Unfortunately they will not let you anywhere near it! |
|
Back to top |
|
|
Quuipo Board Member
Joined: 12 Aug 2009
Posts: 4
|
Posted: Wed Aug 12, 2009 6:14 am Post subject: Re: how to exclude popular search words ? |
|
|
search_stopwords.txt! that's the one!
I must have replaced it accidentally or something.
thank you ! |
|
Back to top |
|
|
drathbun Board Member
Joined: 24 Jul 2008
Posts: 729 Location: Texas
|
Posted: Fri Aug 28, 2009 11:02 pm Post subject: Re: how to exclude popular search words ? |
|
|
To be honest, the search stopwords process is one of the least efficient things that phpBB2 does. You have been given the right advice, but I would like to add two points.
First, if someone searches for stopwords they don't get the message that you mentioned. Their search will simply fail with no results found.
Second, if your stopwords text file gets very large, it can start to impact posting. Even a short post is checked against every single word in the stopwords file. So if you have a three word post and a thousand word stopword file, you will check three thousand words.
Imagine the process going like this:
Get first word of post.
Does it match the first stopword?
Does it match the second stopword?
Does it match the third stopword?
Does it match the fourth stopword?
Does it match...
and so on. Ugly, isn't it? A better approach is to take the word from the post and say, "Is this word on the stopword list" via a SQL query rather than a text file. That has been done on this site (phpbb2refugees) but the code has not yet been written up as a MOD.
I talked (a lot!) about it on my blog, if you want to read more. Here is one in particular that discusses in more detail what I just wrote. _________________ phpBBDoctor Blog |
|
Back to top |
|
|
Quuipo Board Member
Joined: 12 Aug 2009
Posts: 4
|
Posted: Sat Aug 29, 2009 6:02 am Post subject: Re: how to exclude popular search words ? |
|
|
Thanks for that
It's indeed ugly, but luckily I don't have too many search stopwords.
What I did, is add an explanation in the langmain file (search not found result) - adding something along the lines that the search may have included too common words, and try again.
the annoying thing is that it uses that message also if you only search for new posts, but ah well.
if you ever release that mod, let me know |
|
Back to top |
|
|
Holger Board Member
Joined: 19 Jan 2009
Posts: 509 Location: Hanover
|
Posted: Sat Aug 29, 2009 1:58 pm Post subject: Re: how to exclude popular search words ? |
|
|
drathbun ... of course we would LOVE to see your mod released here! |
|
Back to top |
|
|
drathbun Board Member
Joined: 24 Jul 2008
Posts: 729 Location: Texas
|
Posted: Sat Aug 29, 2009 2:49 pm Post subject: Re: how to exclude popular search words ? |
|
|
A lot of it is written up in blog posts. The part that is left to do is the admin part. I do everything by insert statements in the database, so I haven't needed an admin page. _________________ phpBBDoctor Blog |
|
Back to top |
|
|
Holger Board Member
Joined: 19 Jan 2009
Posts: 509 Location: Hanover
|
Posted: Sat Aug 29, 2009 2:50 pm Post subject: Re: how to exclude popular search words ? |
|
|
Cool! Will check that out! |
|
Back to top |
|
|
|