1 rizwank 1.1 %META:TOPICINFO{author="PeterThoeny" date="1097558590" format="1.0" version="1.3"}%
2 %META:TOPICPARENT{name="TWikiVariablesNtoZ"}%
3 #VarSEARCH
4 ---+++ SEARCH{"text"} -- search content
5 * Inline search, shows a search result embedded in a topic
6 * Syntax: =%<nop>SEARCH{"text" ...}%=
7 * Supported parameters: [1]
8 | *Parameter:* | *Description:* | *Default:* |
9 | ="text"= | Search term. Is a keyword search, literal search or regular expression search, depending on the =type= parameter. SearchHelp has more | required |
10 | =search="text"= | (Alternative to above) | N/A |
11 | =web="Name"= <br /> =web="%MAINWEB%, Know"= <br /> =web="all"= | Wiki web to search: A web, a list of webs separated by comma, or =all= webs. [2] | Current web |
12 | =topic="%WEBPREFSTOPIC%"= <br /> =topic="*Bug"= | Limit search to topics: A topic, a topic with asterisk wildcards, or a list of topics separated by comma. | All topics in a web |
13 | =excludetopic="Web*"= <br /> =excludetopic="%HOMETOPIC%, <nop>WebChanges"= | Exclude topics from search: A topic, a topic with asterisk wildcards, or a list of topics separated by comma. | None |
14 | =type="keyword"= <br /> =type="literal"= <br /> =type="regex"= | Do a keyword search like =soap "web service" -shampoo=; a literal search like =web service=; or RegularExpression search like =soap;web service;!shampoo= | =%<nop>SEARCHVARDEFAULTTYPE%= [[TWikiPreferences][preferences]] setting (%SEARCHVARDEFAULTTYPE%) |
15 | =scope="topic"= <br /> =scope="text"= <br /> =scope="all"= | Search topic name (title); the text (body) of topic; or all (both) | ="text"= |
16 | =order="topic"= <br /> =order="created"= <br /> =order="modified"= <br /> =order="editby"= <br /> =order=<br /> "formfield(name)"= | Sort the results of search by the topic names, topic creation time, last modified time, last editor, or named field of TWikiForms. The sorting is done web by web; in case you want to sort across webs, create a [[FormattedSearch][formatted]] table and sort it with TablePlugin's initsort | Sort by topic name |
17 | =limit="all"= <br /> =limit="16"= | Limit the number of results returned. This is done after sorting if =order= is specified | All results |
18 | =reverse="on"= | Reverse the direction of the search | Ascending search |
19 | =casesensitive="on"= | Case sensitive search | Ignore case |
20 | =nosummary="on"= | Show topic title only | Show topic summary |
21 | =bookview="on"= | BookView search, e.g. show complete topic text | Show topic summary |
22 rizwank 1.1 | =nosearch="on"= | Suppress search string | Show search string |
23 | =noheader="on"= | Suppress search header <br /> <span style='background: #FFB0B0;'> *Topics: Changed: By:* </span> | Show search header |
24 | =nototal="on"= | Do not show number of topics found | Show number |
25 | =header="..."= <br /> =format="..."= | Custom format results: see *[[FormattedSearch]]* for usage, variables & examples | Results in table |
26 | =expandvariables="on"= | Expand variables before applying a FormattedSearch on a search hit. Useful to show the expanded text, e.g. to show the result of a SpreadSheetPlugin =%<nop>CALC{}%= instead of the formula | Raw text |
27 | =multiple="on"= | Multiple hits per topic. Each hit can be [[FormattedSearch][formatted]]. The last token is used in case of a regular expression ";" _and_ search | Only one hit per topic |
28 | =separator=", "= | Line separator _between_ hits, effective only in FormattedSearch | Newline ="$n"= |
29 | =newline="%<nop>BR%"= | Line separator _within_ a search hit, effective only in FormattedSearch. Useful to capture multiple lines in a =$pattern()= and to show that in a TWiki table; or to perform a spreadsheet CALCulation on multiple lines | Newline ="$n"= |
30 * Example: =%<nop>SEARCH{"wiki" web="%MAINWEB%" scope="topic"}%=
31 * Example with format: =%<nop>SEARCH{"FAQ" scope="topic" nosearch="on" nototal="on" header="| *Topic: * | *Summary: * |" format="<nop>| $topic | $summary |"%= _(displays results in a table with header - [[FormattedSearch][details]])_
32 * %H% If the TWiki:Plugins.TablePlugin is installed, you may set a =%<nop>TABLE{}%= variable just before the =%<nop>SEARCH{}%= to alter the output of a search. Example: =%<nop>TABLE{ tablewidth="90%" }%=
33 * Related: [[#VarMETASEARCH][METASEARCH]], [[#VarTOPICLIST][TOPICLIST]], [[#VarWEBLIST][WEBLIST]], FormattedSearch, SearchHelp
34
35 * [1] __Note__: The search form uses identical names for input fields.
36 * [2] __Note__: A web can be excluded from a =web="all"= search if you define a =NOSEARCHALL=on= variable in its %WEBPREFSTOPIC%
37 %STOPINCLUDE%
38
39 __Note:__ This topic gets included by TWikiVariablesNtoZ and TWikiVariables
40
41 -- Main.PeterThoeny - 07 Oct 2004
42
|