Tags:
create new tag
, view all tags

Multisearch Add-On

This addon allows a single search dialog to redirect to multiple search engines. We used this for the "search" dialog in our %WEBTOPICLIST% variable, instead of the "go" dialog you see at top of twiki.org.

multisearch.gif

In this example taken from our site, a single search dialog allows you to search both the current web, as well as a mailing list, by just selecting a radio button. Other webs in our site offer different sets of searches.

The form submission goes to multisearch/?type=something&query=inputfield, which then redirects the query to a search engine based on the contents of TWiki.MultiSearch, which contains the master list of available search engines and their query parameters.

Syntax Rules

Here's the relevant contents of our %WEBTOPICLIST% variable:

<FORM ACTION="%SCRIPTURLPATH%/multisearch%SCRIPTSUFFIX%" METHOD="post">
<INPUT TYPE="radio" NAME="type" VALUE="%WEB%" CHECKED>UDN Technical
<INPUT TYPE="radio" NAME="type" VALUE="UnProg">UnProg<BR>
<INPUT TYPE="text" NAME="query" SIZE="15">
<INPUT TYPE="submit" VALUE="Search">
</FORM>

Of course, you can use the same general form anywhere on any page. The "type" field should be a radio button or single-select dropdown list, because there can only be one "type" of search to perform. The "query" field is your input text box, where the actual search text is input.

TWiki.MultiSearch

TWiki.MultiSearch is the topic where the settings for the multisearch addon are stored. The format is as follows:

3 spaces * Type
6 spaces * Action: <search url>
6 spaces * Query field: <fieldname>
6 spaces * Hidden field: <fieldname=fieldvalue> (optional)

"Type" is the name of the search or engine; this is what the "value" field of your radio or listbox should be.

"Action" is the full URL of the search engine.

"Query field" is the CGI variable to pass to the engine with the input text box contents.

"Hidden field" can be present multiple times if necessary, to provide any additional data that the search CGI needs to operate.

Examples:

   * Google
      * Action: http://www.google.com/search
      * Query field: q
      * Hidden field: hl=en

   * Yahoo
      * Action: http://search.yahoo.com/bin/search
      * Query field: p

   * Main
      * Action: %SCRIPTURL%/search%SCRIPTSUFFIX%/Main/
      * Hidden field: scope=text
      * Query field: search

There are no other settings or preferences.

Add-On Example

This is a live TWiki site. Please be considerate.

http://wearforge.perilith.com/bin/view/TWiki/MultiSearch is the multisearch page with the above three searches configured, and a URL like:

http://wearforge.perilith.com/bin/multisearch?type=Google&query=TWiki will redirect you and search Google for "TWiki".

Add-On Installation Instructions

  • Copy multisearch to your bin directory, and add a file extension if necessary.
  • Create a new MultiSearch topic in the TWiki06x00 web and add your search engines to it.

Add-On Info

  • Set SHORTDESCRIPTION = Add a single search dialog that redirects to multiple search engines

Addon Author: RyanFreebern, VitoMiliano
Addon Version: 17 Feb 2002
Change History: 17 Feb 2002: Initial version
CPAN Dependencies: ?
Other Dependencies: ?
Perl Version: ?.?
Addon Home: http://twiki.org/cgi-bin/view/Plugins/MultiSearchAddOn ( TWiki:Plugins/MultiSearchAddOn )
Feedback: http://twiki.org/cgi-bin/view/Plugins/MultiSearchAddOn ( TWiki:Plugins/MultiSearchAddOn )
Topic attachments
I Attachment History Action Size Date Who Comment
Texttxt MultiSearch.txt r1 manage 0.2 K 2002-02-25 - 00:46 VitoMiliano Sample twiki.multisearch document
Unknown file formatEXT multisearch r1 manage 1.2 K 2002-02-25 - 00:46 VitoMiliano multisearch addon
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2006-10-07 - 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-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.