Question
Hi, We're running 4.0.5. We have a number of Webs for the various software modules we create, with further subWebs for different departments. For instance we have ModuleName as a web, with ModuleName/CustomerServices, ModuleName/Development etc as subWebs.
These are very useful divisions for us, but we could really do with an option that allowed us to specify that the search confined itself to the Web, but included all the subWebs within it - i.e. the option to perform a quick search for all info on a particular module, without having to search the whole database.
It would be especially good if we could set this as a checkbox/radio button in, say, the Advanced Search.
Has anyone already done this, or does anyone have any ideas?
I've left the technical specs for this question blank, but if they would be helpful, I can add them.
Environment
--
SimonKnaggs - 24 Nov 2006
Answer
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.
Try looking at the documentation for search at
http://twiki.org/cgi-bin/view/TWiki04/TWikiVariables#SEARCH_text_search_content. It will allow you to do what you want. All you need to do is modify the advanced search page on your web(s). There is an option you can set called
recurse.
Modify the form that feeds the
SEARCH query to allow this to be set with a checkbox or something.
Another more generalized option is to use the
web variable in the search to specify a list of webs you want to search.
| Parameter: |
Description: |
Default: |
web="Name" web="Main, Know" web="all" |
Comma-separated list of webs to search. You can specifically exclude webs from an all search using a minus sign - for example, web="all,-Secretweb". The special word all means all webs that do not have the NOSEARCHALL variable set to on in their WebPreferences. Note that TWikiAccessControls are respected when searching webs; it is much better to use them than NOSEARCHALL. |
Current web |
This could give whatever flexibility you want in searching webs and subwebs.
Note: I have used the
web option of
SEARCH to search multiple webs however I have never tried the
recurse option before but have only seen it in the documentation. I'm assuming it works as documented.
--
RickMach - 25 Nov 2006
Works like a charm - thanks very much Rick.
--
SimonKnaggs - 01 Dec 2006