Tags:
create new tag
view all tags

Question

I'm using a search on the Classification field ina summary page. However some and all of the topics that begin "Web" appear. In fact the page with the search pattern (whose topic name also begine with "Web" appears in all of the segments!

Is ther any way to search for contents (the META Classification values) and exclude topics that begin with "Web"?

-- AntonAylward - 30 Apr 2003

Answer

I do not exactly understand what you try to accomplish, an example would help. Note that you currently cannot search on topic name and topic content, only one or the other. You can do and search on topic content (also on topic name).

To exclude a search string from finding itself (e.g. the topic where the search string is) use a regular expression trick: [F]ood searches for Food; a single character in square brackets is the same like a single character by itself, thus hiding the search string from finding itself.

-- PeterThoeny - 01 May 2003

Question Clarification

  • I have created a web called "Home".
  • I have modified the NewUserTemplate so as to include a reference to Home/%TwikiUser%

The idea is to allow users to have theor own home pages but limiting access to the "Main" web

Thw "WebHome" page of the Home Web is just an index. However that index also shows up all the topics in the Home web whose names begin with "Web". I don't want those to appear.

I've been using true regular expressions (i.e. command line grep-family) for many years. Its the interface from TWiki that confounds me.

I can't make any gaurentees about what the users will put in their pages or what the names of the pages will be. The only thing I'm sure of is I want to exclude thigns like "WebPreferences" from the list, but I can see that I can't delete them.

I've looked at "Meta" serach but I can't see how I can guarentee consistency and as a side effect, the "webhome" topic that has the search pattern in appears in the result.

Does that clarify things?

-- AntonAylward - 01 May 2003

Perl regexes have a feature for negative lookahead, e.g. (?!Web).* would match topic names not starting with 'Web' - see perldoc perlre. However, TWiki uses the external grep command, which does not have such a feature (according to the Friedl book, http://regex.info/). So I don't believe you can do this except by installing a suitable Perl-based grep - try tcgrep for one example. You will get a performance hit compared to a non-Perl grep, though, see Google:twiki+perl+grep+speed.

To eliminate the page with the search pattern from the result, try searching for something like Foo using the pattern [F]oo - this matches the Foo text in all pages but does not match itself.

-- RichardDonkin - 01 May 2003

I beg to differ: try these commands

  $ cd ~twiki/data/Twiki
  $ ls
  $ ls | grep Web
  $ ls | grep -v Web

Of course you can play with anchors and more involved REs. You can also play with egrep, which is what I habitually use from the command line. (They happen to be the same program on my Linux box.)

So, puit it another way, since I don't need a RE in context, as I've jsut shown, how do I get more detailed control over the command line of grep from within TWiki?

-- AntonAylward - 01 May 2003

You can do that also with the current setup: Do a regex search for ^([^W]|W[^e]|We[^b]) on topic names. Example: https://www.twiki.org/cgi-bin/search/Support/?search=%5E%28%5B%5EW%5D%7CW%5B%5Ee%5D%7CWe%5B%5Eb%5D%29&scope=topic&regex=on

-- PeterThoeny - 02 May 2003

One word:

  WebsterJackson wink

-- AntonAylward - 02 May 2003

ExcludeWebTopicsFromSearch is now implemented in latest TWikiBetaRelease.

-- PeterThoeny - 04 Jan 2004

Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2004-01-04 - PeterThoeny
 
  • 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.