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.

The phpBB2 Search function


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



Joined: 19 Nov 2008

Posts: 656
Location: North West UK


flag
PostPosted: Thu Apr 09, 2015 3:42 am 
Post subject: The phpBB2 Search function

My site is model airplane related and of course the word "engine" will occur in a heck of a lot of posts. Also by virtue of the fuel we use the word "cleaning" is also going to occur many times. Now we have a topic from way back where members were talking about "Engine cleaning" but that was not the topic title and the discussion just happened within a topic.
If we use the search function using "Engine AND cleaning" it returns every topic that has the word "engine" in it and the word "cleaning" in it but not necessarily in the same post. What we really need is for it to return "Engine cleaning" together as a pair.
Does anyone know of a mod that will add that ability to the search function?

Jim

_________________
The truth is out there.
Unfortunately they will not let you anywhere near it!
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 449
Location: Québec


flag
PostPosted: Thu Apr 09, 2015 12:27 pm 
Post subject: Re: The phpBB2 Search function

Quick answer: I don't.

Alternative answer: Adding a custom Google search, if your boards are public, might be the easiest way and probably the most effective. Adding quotes around your search would give you that functionality and still be combinable with other syntax, e.g. "engine cleaning" AND accident.

Long answer: Looking at the code, I'm not sure it's possible without rewriting a different search engine. As you may know, phpBB2 search doesn't go through your post_text table but through a word list that is updated every time a new message is posted. Therefore, to look for a string of words, you not only need to be able to parse that request, which in itself would require a good deal of work to integrate with the existing engine, but you would also need that particular string of words to have been saved in the search index. And obviously, indexing every possible phrase would likely be even worse than looking straight at the post texts.

So you would need a completely separate routine that does not dissect your search string and looks through every post's text instead, which I expect could be a problem on large boards. The query itself would be trivial but then you have to pad it with a lot of security checks like forum visibility, censored words, etc. and you'd probably run into timeouts. Adding a custom search field from one of the big players out there would give you all of the functionality and none of the server load, so I think it should be the way to go at this stage in phpBB2's life.
Back to top
Jim_UK
Board Member



Joined: 19 Nov 2008

Posts: 656
Location: North West UK


flag
PostPosted: Thu Apr 09, 2015 1:09 pm 
Post subject: Re: The phpBB2 Search function

Ok with Google but how to get it to just give results on the site and not from all over the web?

Jim

_________________
The truth is out there.
Unfortunately they will not let you anywhere near it!
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 449
Location: Québec


flag
PostPosted: Thu Apr 09, 2015 2:27 pm 
Post subject: Re: The phpBB2 Search function

Just add site:example.com to your search terms icon_smile.gif

Presumably their custom search bar code allows options like these to be activated by default, but I've never used it.
Back to top
Jim_UK
Board Member



Joined: 19 Nov 2008

Posts: 656
Location: North West UK


flag
PostPosted: Thu Apr 09, 2015 3:16 pm 
Post subject: Re: The phpBB2 Search function

I am afraid that I met with no success using that as it returned posts with cleaning and with engine but not "cleaning engine" as a single phrase.

Jim

_________________
The truth is out there.
Unfortunately they will not let you anywhere near it!
Back to top
lumpy burgertushie
Board Member



Joined: 18 Nov 2008

Posts: 266


flag
PostPosted: Thu Apr 09, 2015 10:21 pm 
Post subject: Re: The phpBB2 Search function

it has been a while since I used it, but if I remember correctly, using google search for your site only brings results from your site.

to search for the phrase engine cleaning on your board using google.com do this:

"engine cleaning" site:yourboard.com

robert
Back to top
Jim_UK
Board Member



Joined: 19 Nov 2008

Posts: 656
Location: North West UK


flag
PostPosted: Fri Apr 10, 2015 3:25 am 
Post subject: Re: The phpBB2 Search function

Hi Robert.
I have done that and it would work I am sure but of course the expression needs to be exactly correct and what it returned was no results for "engine cleaning" and it then did a search for the individual words bringing back several results.

One problem might be that Google does not fully index the site when it visits. I have a mod installed that monitors bots and the percentage of the site they look at when they visit.
Google never looks at more than 1 "page" and then leaves whilst Yahoo, msnbot and bingbot commonly do 100%

It might be worth doing the search on Yahoo so will try that later after my morning cuppa.

Jim

Edit
I have just tried that search on Yahoo and it did indeed find the various topics that were about "engine cleaning"

Many thanks for all the advice - problem now is to get Google to index the site as well as the other bots do.

_________________
The truth is out there.
Unfortunately they will not let you anywhere near it!
Back to top
nostro
Board Member



Joined: 16 Jul 2012

Posts: 54


flag
PostPosted: Sun Apr 12, 2015 8:52 am 
Post subject: Re: The phpBB2 Search function

Couldn't you just use Yahoo or Bing instead of Google? Isn't there a mod for that?
Back to top
Jim_UK
Board Member



Joined: 19 Nov 2008

Posts: 656
Location: North West UK


flag
PostPosted: Sun Apr 12, 2015 8:59 am 
Post subject: Re: The phpBB2 Search function

I have added a Yahoo search to the search_body.tpl file and it is working just fine.

Code:
<table>
<form method="get" action="http://search.yahoo.com/search">
<fieldset>
<input type="text" name="p" size="35" maxlength="255" value="" align="center" />
<input type="submit" value="Search this site with YaHoo!" />
<input type="hidden" name="vs" value="yoursiteurl" />
</fieldset>
</form>
</table>


Let Yahoo take the strain icon_wink.gif

Jim

_________________
The truth is out there.
Unfortunately they will not let you anywhere near it!
Back to top
lumpy burgertushie
Board Member



Joined: 18 Nov 2008

Posts: 266


flag
PostPosted: Sun Apr 12, 2015 11:05 pm 
Post subject: Re: The phpBB2 Search function

If what you want is the search on the board to work then that is fine. however, if google is not indexing your site properly then you will be missing a lot of visitors that would come in through google. I don't think yahoo search or even bing are anywhere close the google in terms of users.


robert
Back to top
Jim_UK
Board Member



Joined: 19 Nov 2008

Posts: 656
Location: North West UK


flag
PostPosted: Mon Apr 13, 2015 3:02 am 
Post subject: Re: The phpBB2 Search function

Hi Robert,
My site is dedicated to a very minority interest - model aircraft but they fly on lines and not radio control and I doubt if there are any control line flyers that are not aware we are there so that was not an issue.
Google visits the site twice as often as Yahoo but the difference is how much it indexes when it does. Visits are short lived whilst Yahoo and Bing(msn) seem to be almost constantly there.

Strange thing is happening with the Yahoo search I have added is that for me it does just as expected, giving on site hits, whilst for one of the moderators all it does is to open a Yahoo search page showing commercial results with none from the site!

I will have to take a look at why Google is not fully indexing the site.

Jim

Edit
Can someone take a look at my robots.txt file and see if anything is wrong with it. I have restricted I hope access to named bots as we were getting inundated with them to the extent that they were slowing down page generation.
Code:

User-agent: *
Disallow: /

User-agent: GoogleBot
Allow: phpBB2/

User-agent: GoogleBot-Mobile
Allow: phpBB2/

User-agent: Slurp
Allow: phpBB2/

User-agent: yahoo-mmcrawler
Allow: phpBB2/

User-agent: Alexa
Allow: phpBB2/

User-agent: AskJeeves
Allow: phpBB2/

User-agent: bingbot
Allow: phpBB2/

_________________
The truth is out there.
Unfortunately they will not let you anywhere near it!
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 - 4 Hours
 
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.0569 seconds using 16 queries. (SQL 0.0148 Parse 0.0009 Other 0.0413)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo