Tags:
create new tag
, view all tags

Question

I have a search based on formfields. I want to exclude child topics (of the base topic) from the search. Ideally I want to exclude all offspring (eg grandchildren too etc).

I can create the 2 searches separately but cannot combine them.


My formfield search looks like this:
%SEARCH{"[F]ieldName.*value\=.*Example" type="regex" nonoise="on" format="   * [[$topic]]"}%

So this gives a bullet list of all topics with the FieldName=Example

%SEARCH{"META\:TOPICPARENT.*\"%TOPIC%\"" type="regex" format="$topic"}%
lists all the children, or

%TREE{topic="%TOPIC%" format="$topic"}%
lists all the offspring including grandchildren etc.

Trying to combine the first search with the %TREE%:

%SEARCH{"[F]ieldName.*value\=.*Example" excludetopic="%TREE{topic="$percntTOPIC$percnt" format="$topic"}%" type="regex" nonoise="on" format="   * [[$topic]]"}%
This give the same results as the first search, ie it is not recognising the excludetopic bit.

Can anyone help?

Thanks Tamsin

Environment

TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories: Search

-- TamsinTweddell - 15 Apr 2008

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

This looks like the inverse of SearchWithinTopicTree. I think you need to upgarde to the latest version of TreePlugin that allows you to pass back the tree as a comma separated list. See below for my example of a search that only includes children and grandchildren. I believe you can do the same for the exclude topic parameter in your example above.

%SEARCH{search="junk" web="Foo" topic="%TREEVIEW{web="Foo" topic="GrandParent" format="$topic" nodiv="1" separator=", "}%"}%

-- DeanSpicer - 15 Apr 2008

That's fantastic. Thanks. I was trying to do something similar, but hadn't noticed that the separator parameter wasn't in the version of TreePlugin I was using.

-- TamsinTweddell - 18 Apr 2008

 
Change status to:
Topic revision: r4 - 2008-04-29 - DeanSpicer
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.