This question about Topic Markup Language and applications: Answered

How to exclude pages from search results

We keep meeting minutes in Foswiki. These minutes often contain updates for projects and therefore use a lot of keywords within that project.

Unfortunately, this means when searching for these keywords the minutes are often at the top of the search results.

I have been looking for instructions on how to exclude pages from being indexed by the search function to prevent them from appearing in the search results.

So far I have not come up with anyway of doing this.

-- CarlReid - 09 May 2011

Have a look at VarSEARCH, param excludetopic. You can pass a list of topics, of a wildcard, for instance: excludetopic="MeetingMinute*"

-- ArthurClemens - 09 May 2011

Thanks for the reply Arthur but where does this parameter get entered? We want the main search box to be changed to exclude the minute topics. It is possible to modify the main search box?

If not, do you know whether you can create your own custom search page where it is possible to exlude specific topics. I am aware that you can use the search syntax on any page however I do not know how to get this working with a textbox that allows users to searc for what they want?

Any further help would be much appreciated!!

-- CarlReid - 11 May 2011

The search box in the top bar is defined in WebTopBar which in turn refers to WebSearch. So you can add excludetopic in WebSearch. However, be aware that you're changing a system topic which will be overwritten on the next upgrade (to a new Foswiki version).

-- MartinKaufmann - 11 May 2011

In addition: SEARCH parameters can be passed in the form as hidden fields:
<input type="hidden" name="excludetopic" value="..." />

Patch releases (upgrade versions) do usually not include the system topics.

-- ArthurClemens - 11 May 2011

Many thanks for your help on this. We managed to get this working as we need by modifying the WEBSEARCH topic as follows:
%SEARCH{
...
excludetopic="%URLPARAM{"excludetopic" encode="quote"}%,*Meeting*"
...
}%%ENDSECTION{"searchresults"}%


Using this approach you will never find those Meeting topics.

-- ArthurClemens - 12 May 2011

QuestionForm edit

Subject Topic Markup Language and applications
Extension
Version Foswiki 1.1.2
Status Answered
Topic revision: r8 - 12 May 2011, ArthurClemens
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy