phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

how to exclude popular search words ?


 
Search this topic... | Search phpBB2 Discussion... | Search Box
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Author Message
Quuipo
Board Member



Joined: 12 Aug 2009

Posts: 4



PostPosted: Wed Aug 12, 2009 8: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 icon_smile.gif

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 icon_smile.gif

edit: whoops, sorry, I see i posted this in the wrong section
Back to top
Jim_UK
Board Member



Joined: 19 Nov 2008

Posts: 556
Location: North West UK


flag
PostPosted: Wed Aug 12, 2009 9: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



PostPosted: Wed Aug 12, 2009 10: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: 666
Location: Texas


flag
PostPosted: Sat Aug 29, 2009 3:02 am 
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? icon_smile.gif 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



PostPosted: Sat Aug 29, 2009 10:02 am 
Post subject: Re: how to exclude popular search words ?

Thanks for that icon_smile.gif

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 icon_mrgreen.gif
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Sat Aug 29, 2009 5:58 pm 
Post subject: Re: how to exclude popular search words ?

drathbun ... of course we would LOVE to see your mod released here! icon_mrgreen.gif
Back to top
drathbun
Board Member



Joined: 24 Jul 2008

Posts: 666
Location: Texas


flag
PostPosted: Sat Aug 29, 2009 6: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. icon_smile.gif
_________________
phpBBDoctor Blog
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Sat Aug 29, 2009 6:50 pm 
Post subject: Re: how to exclude popular search words ?

Cool! Will check that out!
Back to top
Display posts from previous:   
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0338 seconds using 15 queries. (SQL 0.0089 Parse 0.0009 Other 0.0240)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo