Your premium source for custom modification services for phpBB


HomeForumsBlogMOD ManagerFAQSearchRegisterLogin

Comments August 12, 2007

Another Search Tweak: Marking Topics “Unsearchable”

Filed under: MOD Writing, Search, phpBB — Dave Rathbun @ 12:29 pm CommentsComments (3) 

As regular blog readers will probably know, I am always playing around with the search process. On my largest board I now have nearly 350K posts, and anything I can do to make the search process even marginally more effective and efficient can help. My latest idea (which I was up until the “wee hours” a few nights ago building a prototype for) is to grant moderators the ability to mark a topic with an “unsearchable” flag.

If you run or even just participate on a board of any size, you have probably seen this sort of exchange:

noob: Can anyone tell me about “foo”?
member 1: Geez, didn’t you try searching for “foo” first?
member 2: They must not have searched, since a search for “foo and bar” returns everything you need to know
member 3: It’s even a FAQ: Everything Important about Foo Click Here
noob: I will search for “foo” next time :oops:

As you probably know, topics are indexed from most recent to oldest. So when Noob #2 comes to the board and actually does a search for “foo”, what are they going to find first? Odds are they will find all of the “why didn’t you search for foo” topics rather than the actual content. So it’s quite frustrating, for everyone involved. Eventually you get two or more pages of “please search” responses, and nobody can ever get to the content.

So the idea behind this MOD is to stop indexing those posts, leaving only the desirable content as searchable. It would be excellent if there was some way to automate this decision process, but for the initial attempt I am sticking with a manual moderator action.

And the best part? As I have prototyped it, this will impact only keyword searches. Other searches (like “my posts” or “last 24 hours” and “view all posts by Dave”) will still work. There are no changes made to search.php at all. The only trick is to add or remove the words into the phpbb_search_wordmatch table during the posting process based on the setting for this flag. I have opted to make this a topic option rather than a post option, but that could be debated.

It’s fairly simple. I pass in to the submit_post() function two additional pieces of information. One is the search status setting from the form, and the other is the search status setting of the topic. If the search status selected on the form is different from the search status stored in the database, then the rows in the search match table are either added or removed accordingly. If the poster is not a moderator, then the search setting from the form and the existing search status are always going to be the same, and the standard process takes place.

I have defaulted the searchable status to On, as that makes the most sense. I am playing with the idea that a board owner might want to be able to specify certain forms as off. This would allow you to mark the “Off Topic” forum topics as all non-searchable and that might save some space. If I were to do that, though, I would have to write code for the moderator control panel “move” option. I would have to build or destroy the search keyword rows based on whether the source / destination forums were searchable or not. I have not decided whether this feature is worth the extra code or not.

So, what do you think? Is this a worthwhile MOD? I am definitely going to implement it on my own board and will try to report back in a few months as to how it has worked out.


  1. Another great idea. Dave you really need to chat to naderman about the search system in phpBB, he is the main committer to that side and some of your ideas should become core.

    Comment by Esmond Poynton — August 14, 2007 @ 1:54 am

  2. I believe he has an interesting project underway related to the search functions at phpbb.com. I did have a conversation with him via IRC a while back, but I don’t know how much of what he shared was private so to be safe right now I won’t share anything. I will ask him what if anything I can share about his plans. Or maybe he can come and share something here himself. I think his plans are extremely interesting. :D

    Comment by dave.rathbun — August 14, 2007 @ 12:02 pm

  3. Esmond, my comment in response to your comment turned into a post instead. :lol:

    Comment by dave.rathbun — August 14, 2007 @ 7:39 pm

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress