key Log In

You are here: wiki.fini > Sandbox Web > TWikiUsers > CynthiaManuel > CynthiaManuelSandbox

Start of topic | Skip to actions
Is it possible to limit a search to the children of a topic, without using metasearch?

Yes it is. You can do an and search on the topic parent and other content you are searching for, with regex on.

For example:

%SEARCH{ "MyDog*;%TOPIC%" web="%WEB%" topic="MyDog*" type="regex" }%

So to break that down,

  • web=%WEB% limits the search to only the web we're in.
  • topic= MyDog* limits the search to only topics whose title is MyDogblahblah, where blah blah is any character or characters after MyDog.
  • Type=regex allows us to search with regular expressions which is what let's us pick up MyDog'sTail as well as MyDog'sPaw. More specifically, searching with regex=on allows us to use regular expressions such as the * in this example.
  • Now the best part MyDog* ; %TOPIC%. The semi-colon is the magic that produces the AND. This tells the search to search for MyDog* AND %TOPIC%. Searching for MyDog* (remember the astrick in the search means any character or characters) AND %TOPIC% returns MyDog topics that are associated with the topic the search is being performed from.

So given the following topic relationships:

MyPets
line_udr MyDog

line_ur MyDog'sPaw
line_ur MyCat
line_ur MyDogAteMyCat

If we embed this search in the MyDog topic, MyDog and MyDog's Paw would be returned. MyDogAteMyCat would not be returned because the parent is MyCat which is not a child of the topic MyDog. (Remember we kept our search to only the topic MyDog by adding ; %TOPIC% in our query string.

 
 



tip TWiki Tip of the Day
Custom rendered bullets
The RenderListPlugin can render bulleted lists in a variety of different ways. Use %RENDERLIST{ parameters ... Read on Read more


This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding wiki.fini? Send feedback