Support Forum

Search functionality

AA Amanda Aitken
Amanda Aitken
Member

Hello,

I’m just trying out the search functionality in my new forum, and it seems that the titles of topics are not being “scanned” for the keywords searched for.

In other words, there is a post with the title “Justin is here” in the forum, and searching for “Justin” does not bring up that topic in the search results.

Is there a way to change this so that it’s not just the body of the post that is “scanned” for keywords searched for using the search functionality?

Thanks!

8 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

Is this using the full ‘Advanced Search’ set of optional criteria?

AA Amanda Aitken
Amanda Aitken
Member

Ahh – I see what you mean. It works as long as I use the advanced search and indicate that I want to search topic titles, too.

 

Is there a way to set the forum so that it automatically searches topic titles in addition to the body of posts?

YS Yellow Swordfish
Yellow Swordfish
Member

Yes indeed, it means a small edit to one of the display templates. In this case the spHead.php template of the SP theme you are using (in the /templates folder). If you locate the section that starts with the  comment:

# == Search FORM – OBJECT DEFINITION

And go to the bottom of that definition block you will see the entry named ‘searchIncludeDef‘ which is by default, set to 1. You would need to change the 1 to a 3 as it says in the comment beside it.

The reason this is not the default is that there is a resource and performance hit performing the content and titles search. But if you forum is not too large or bust=y this probably will not be that noticeable.

As always we recommend that you create your own SP theme so that any customisation is not lost during a future update. (http://codex.simple-press.com/codex/themes/theme-basics/creating-a-theme/)

AA Amanda Aitken
Amanda Aitken
Member

Thank you! I’m trying to find the “templates” folder inside the simple-press folder in my “plugins” folder, but am not having any luck. Would you mind directing me?

Thanks!

MP Mr Papa
Mr Papa
Member

thanks for the update… did you make your own theme as suggested?

AA Amanda Aitken
Amanda Aitken
Member

I didn’t, because I’m in a bit of a rush! But I’ll look into it!

MP Mr Papa
Mr Papa
Member

until you do, just be advised, if you update any of our themes, your changes will be lost…