Tags:
component1Add my vote for this tag forms1Add my vote for this tag search1Add my vote for this tag twiki_application1Add my vote for this tag create new tag
, view all tags

Generate Search Plugin

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.

Syntax Rules

  • Syntax: %GENERATESEARCH{"topic" ...}%
  • Supported parameters:
    Parameter: Description: Default:
    "topicregex" 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 undefined

Example

Below is an example form from TWikiForms:

Name Type Size Values Tooltip message
TopicClassification select 1 NoDisclosure, PublicSupported, PublicFAQ blah blah...
OperatingSystem checkbox 3 OsHPUX, OsLinux, OsSolaris, OsWin blah blah...
OsVersion text 16   blah blah...

If this plugins is installed, the variable

%GENERATESEARCH{topic="Web.*" title="Search knowledge base" initial="off" message="(may use regular expressions)" }%

will expand as follows:

Output     Expected
FieldShowFilter
TopicClassification
OperatingSystem
OsVersion
Select all
   %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:

search.jpg

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".)

Plugin Settings

  • One line description, is shown in the TextFormattingRules topic:
    • 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:
    File: Description:
    data/TWiki/GenerateSearchPlugin.txt Plugin topic
    data/TWiki/GenerateSearchPlugin.txt,v Plugin topic repository
    pub/TWiki/GenerateSearchPlugin/search.jpg Attached graphic
    pub/TWiki/GenerateSearchPlugin/search.jpg,v Attached graphic repository
    bin/gensearch cgi script (deprecated - can use restHandler instead)
    templates/oopsgensearch.tmpl Template defining the appearance of the search page
    lib/TWiki/Plugins/GenerateSearchPlugin.pm Plugin Perl module
  • (Dakar) Visit configure in your TWiki installation, and enable the plugin in the {Plugins} section.
  • Test if the installation was successful:
    • See if above example rendered correctly

Plugin Info

Plugin Author: TWiki:Main/ThomasWeigert
Plugin Version: 13 Apr 2005 (V1.000)
Change History:  
23 Feb 2006: TWiki:Main.SvenDowideit: update to Dakar (rest&registerHandler), added inline param, made filter display conditional on there being a filter specified
13 Apr 2005: Added the ability to search through multiple webs
25 Feb 2005: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.024
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
TWiki:Plugins/Benchmark: GoodStyle nn%, FormattedSearch nn%, GenerateSearchPlugin nn%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/GenerateSearchPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/GenerateSearchPluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/GenerateSearchPluginAppraisal

Related Topics: TWikiForms

-- TWiki:Main/ThomasWeigert - 13 Apr 2005

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatmd5 GenerateSearchPlugin.md5 r4 r3 r2 r1 manage 0.2 K 2008-12-12 - 11:30 SopanShewale checksum file , Uploaded as a part of Release Process
Compressed Zip archivetgz GenerateSearchPlugin.tgz r4 r3 r2 r1 manage 26.8 K 2008-12-12 - 11:30 SopanShewale See GenerateSearchPlugin for details. Untar and run the installer script, Uploaded as a part of Release Process
Compressed Zip archivezip GenerateSearchPlugin.zip r9 r8 r7 r6 r5 manage 29.5 K 2008-12-12 - 11:30 SopanShewale See GenerateSearchPlugin for details. Unzip and run the installer script , Uploaded as a part of Release Process
Unknown file formatEXT GenerateSearchPlugin_installer r3 r2 r1 manage 3.5 K 2008-12-12 - 11:30 SopanShewale Installer Script, Uploaded as a part of Release Process
Edit | Attach | Watch | Print version | History: r14 < r13 < r12 < r11 < r10 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r14 - 2008-12-12 - SopanShewale
 
  • 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-2016 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.