Tags:
create new tag
view all tags

SID-01036: How to exclude current topic from search results

Status: Answered Answered TWiki version: 4.3.2 Perl version:
Category: CategorySearch Server OS: Last update: 15 years ago

I am building a help system in our wiki. At the bottom of each topic I display a Related Topics list. The list of related topics is generated by an INCLUDE variable that fetches a formatted search from a generic topic called Help Setup. This Help Setup is not used for anything other than holding bits of stuff I want to INCLUDE else where.

It works great and looks nice; although I had to plan search categories to ensure I added common terms in groups of related topics so the search would find them. I put these common terms in HTML metatags at the top of each topic.

The problem is this, at least one search hit on every page is self referential to the document in which it is displayed. For example, in a topic called "How to Create ABC" one of the related topic search hits is "How to Create ABC". This is silly.

How do I run this related topic formatted search and exclude the current document from displaying in the results while also running it via an INCLUDE var? I've tried EXCLUDETOPIC but don't know how to reference page. I am not a coder, so please be very literal in your advice.

Here is my setup: %STARTSECTION{name="RelatedAreaAssets" type="section"}%

Related Topics

%TABLE{ tablewidth="50%"}% %SEARCH{"VDHLP-Assets" web="Engineering" scope="text" type="keyword" nosearch="on" nototal="on" excludetopic="HelpSetup" format="| $topic | $date | $wikiusername |" }%
%ENDSECTION{"RelatedAreaAssets"}%

Thanks in advance, Dean

-- TWikiGuest - 2010-11-24

Discussion and Answer

Hello.

Try

excludetopic="%INCLUDINGTOPIC%" 

-- EnriqueCadalso - 2010-11-24

Hi, Thanks, that does the job. I was stuck on trying to use %TOPIC%, which didn't work.

-- DeanCloutier - 2010-11-24

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
SupportForm
Status Answered
Title How to exclude current topic from search results
SupportCategory CategorySearch
TWiki version 4.3.2
Server OS

Web server

Perl version

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2010-11-24 - DeanCloutier
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.