This plugin creates a form-driven search over the topics of a selected web.
TWiki:Main/TWikiInstallation demonstrates a widely used TWiki application: A search where the search results can be filtered based on parameters entered by the user in a form.
This plugin generates such searches automatically from the field values defined in a TWikiForms. The user is presented with a table of possible fields and can select whether the field should be shown as the result of the search, and whether it should be possible to filter on that field.
A regular expression determining the topics to be searched
required
form="..."
The topic defining the field values
Current topic
web="..."
The webs that will be searched, separated by commas. If there is more than one web, a select is presented to the user that allows to search any single one or all of the indicated webs
Current web
all="..."
If off, generates a select menu to choose among the possible webs to be searched; if on, all webs (see above) are searched.
on
title="..."
The heading for the search page generated
message="..."
Additional explanatory text to be added before the filter block
initial="..."
Determines whether the initial rendering of the search form also executes the search. Possible values are on, off
on
inline="..."
Puts the results of the generated search inline in the topic. Possible values are on, off
off
show="..."
A comma seperated list of columns that you want to show. If its not defined, then we show all fields
undefined
filter="..."
A comma seperated list of columns that you want to filter by. If its not defined, then we filter all fields
%GENERATESEARCH{topic="Web.*" title="Search knowledge base" initial="off" message="(may use regular expressions)" }%
will expand as follows:
Output
Expected
%GENERATESEARCH{topic="Web.*" title="Search knowledge base" initial="off" message="(may use regular expressions)" }%
Selecting "Show" for a field will display this field for search results. Selecting "Filter" for a field will allow to filter search results by specific values. If the user were to select all fields (for which the "Select all" short cut can be used), the following query page would be generated:
As can be seen, fields with defined values yield a drop down menu to select the possible values (this works for select, radio, and checkbox fields), while all other fields have a text box to enter values. The search result is filtered such that the form fields contain the filter values. Note that this search uses regular expression, and thus, regular expressions may also be entered as filters. (Note that "Filter" implies "Show".)
Set SHORTDESCRIPTION = This plugin generates a form-driven search based on a TWikiForms.
Debug plugin: (See output in data/debug.txt)
Set DEBUG = 0
Plugin Installation Instructions
Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.
Download the ZIP file from the Plugin web (see below)
Unzip GenerateSearchPlugin.zip in your twiki installation directory. Content: