~kosova/+junk/tuxfamily-twiki

« back to all changes in this revision

Viewing changes to foswiki/data/System/VarSEARCH.txt

  • Committer: James Michael DuPont
  • Date: 2009-07-18 19:58:49 UTC
  • Revision ID: jamesmikedupont@gmail.com-20090718195849-vgbmaht2ys791uo2
added foswiki

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%META:TOPICINFO{author="ProjectContributor" date="1231502400" format="1.1" version="1"}%
 
2
%META:TOPICPARENT{name="Macros"}%
 
3
#VarSEARCH
 
4
 
 
5
---+++ SEARCH{"text"} -- search content
 
6
   * Inline search, shows a search result embedded in a topic
 
7
   * Syntax: =%<nop>SEARCH{"text" ...}%=
 
8
   * Supported parameters:
 
9
     | *Parameter:* | *Description:* | *Default:* |
 
10
     | ="text"= | Search term. Is a keyword search, literal search, regular expression search, or query, depending on the =type= parameter. SearchHelp has more | required |
 
11
     | =search="text"= | (Alternative to above) | N/A |
 
12
     | =web="Name"= <br /> =web="%USERSWEB%, Know"= <br /> =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= preference set to =on= in their %WEBPREFSTOPIC%. Note that [[AccessControl][AccessControls]] are respected when searching webs; it is *much* better to use them than =NOSEARCHALL=. | Current web |
 
13
     | =topic="%WEBPREFSTOPIC%"= <br /> =topic="*Bug"= | Limit search to topics: A topic, a topic with asterisk wildcards, or a list of topics separated by comma. *Note* this is a list of *topic names* and must *not* include web names. | All topics in a web |
 
14
     | =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. *Note* this is a list of *topic names* and must *not* include web names. | None |
 
15
     | =scope="topic"= <br /> =scope="text"= <br /> =scope="all"= | Search topic name (title); the text (body) of topic; or all (title and body) | ="text"= |
 
16
     | =type="keyword"= <br /> =type="word"= <br /> =type="literal"= <br /> =type="regex"= <br /> =type="query"= | Control how the search is performed when =scope="text"= or =scope="all"= <hr /> =keyword=: use Google-like controls as in =soap "web service" -shampoo=; searches word parts: using the example, topics with "soapsuds" will be found as well, but topics with "shampoos" will be excluded <hr /> =word=: identical to =keyword= but searches whole words: topics with "soapsuds" will not be found, and topics with "shampoos" will not be excluded <hr /> =literal=: search for the exact string, like =web service= <hr /> =regex=: use a RegularExpression search like =soap;web service;!shampoo=; to search on whole words use =\bsoap\b= <hr /> =query=: [[query search]] of form fields and other meta-data, like =(Firstname='Emma' OR Firstname='John') AND Lastname='Peel'= | =%<nop>SEARCHVAR- DEFAULTTYPE%= [[DefaultPreferences][preferences]] setting (%SEARCHVARDEFAULTTYPE%) |
 
17
     | =order="topic"= <br /> =order="created"= <br />  =order="modified"= <br /> =order="editby"= <br /> =order=<br />&nbsp;"formfield(name)"= | Sort the results of search by the topic names, topic creation time, last modified time, last editor, or named field of DataForms. The sorting is done web by web; if you want to sort across webs, create a [[FormattedSearch][formatted]] table and sort it with TablePlugin's initsort. Note that dates are sorted most recent date *last* (i.e at the bottom of the table). | Sort by topic name |
 
18
     | =limit="all"= <br /> =limit="16"= | Limit the number of topics from which results will be returned. This is done after sorting if =order= is specified. Note that this does not limit the number of hits from the same topic when you have multiple="on". | All results |
 
19
     | =date="..."= | limits the results to those pages with latest edit time in the given [[TimeSpecifications#TimeIntervals][time interval]].  | All results |
 
20
     | =reverse="on"= | Reverse the direction of the search | Ascending search |
 
21
     | =casesensitive="on"= | Case sensitive search | Ignore case |
 
22
     | =bookview="on"= | BookView search, e.g. show complete topic text. Very resource demanding. Use only with small result sets | Show entire topic content. |
 
23
     | =nonoise="on"= | Shorthand for =nosummary="on" nosearch="on" nototal="on" zeroresults="off" noheader="on" noempty="on"= | Off |
 
24
     | =nosummary="on"= | Show topic title only | Show topic summary |
 
25
     | =nosearch="on"= | Suppress search string | Show search string |
 
26
     | =noheader="on"= | Suppress default search header <br /> <span style='background: #FFB0B0;'> *Topics: Changed: By:* </span>, unless a =header= is explicitly specified  | Show default search header, unless search is inline and a format is specified (Cairo compatibility) |
 
27
     | =nototal="on"= | Do not show number of topics found | Show number |
 
28
     | =zeroresults="off"= | Suppress all output if there are no hits | =zeroresults="on"=, displays: "Number of topics: 0" |
 
29
     | =noempty="on"= | Suppress results for webs that have no hits. | Show webs with no hits |
 
30
     | =header="..."= <br /> =format="..."= <br /> =footer="..."= | Custom format results: see *[[FormattedSearch]]* for usage &amp; examples | Results in table |
 
31
     | =expandvariables="on"= | Expand embedded macros 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 |
 
32
     | =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 |
 
33
     | =nofinalnewline="on"= | If =on=, the search variable does not end in a line by itself. Any text continuing immediately after the SEARCH macro on the same line will be rendered as part of the table generated by the search, if appropriate. | =off= |
 
34
     | =recurse="on"= | Recurse into subwebs, if subwebs are enabled. | =off= |
 
35
     | =separator=", "= | Line separator _between_ search hits | ="$n"= (Newline) |
 
36
     | =newline="%<nop>BR%"= | Line separator _within_ a search hit. Useful if you want to put multi-line content into a table cell, for example if the format="" parameter contains a $pattern() that captures more than one line, or contains a $formfield() that returns a multi-line textfield. | ="$n"= (Newline) |
 
37
   * Example: =%<nop>SEARCH{"wiki" web="%USERSWEB%" scope="topic"}%=
 
38
   * 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]])_
 
39
   * %T% If the Foswiki:Extensions.TablePlugin is installed, you may put a =%<nop>TABLE{}%= macro just before the =%<nop>SEARCH{}%= to alter the output of a search.  Example: =%<nop>TABLE{ tablewidth="90%" }%=
 
40
   * Related: [[%IF{"'%INCLUDINGTOPIC%'='Macros'" then="#"}%VarMETASEARCH][METASEARCH]], [[%IF{"'%INCLUDINGTOPIC%'='Macros'" then="#"}%VarTOPICLIST][TOPICLIST]], [[%IF{"'%INCLUDINGTOPIC%'='Macros'" then="#"}%VarWEBLIST][WEBLIST]], FormattedSearch, QuerySearch, SearchHelp, SearchPatternCookbook, RegularExpression