/
NatSearch.txt
67 lines (55 loc) · 3.41 KB
/
NatSearch.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
%META:TOPICINFO{author="ProjectContributor" date="1232036349" format="1.1" version="1.2"}%
%META:TOPICPARENT{name="NatSkin"}%
---+!! %TOPIC%
Search facility for the NatSkin.
%TOC%
---++ Description
<nop>NatSearch unifies the Jump & Search boxes known from the standard distribution. It
uses one input field to either jump to a topic or perform a query. You can even
use it as a quick way to create and edit new topic by entering =e:NewTopic= into the input field.
<nop>NatSearch is heavily inspired by the <nop>PhotonSearch by Esteban Manchado Velázquez.
---++ Usage
<nop>NatSearch basically first tries to find the named topic and jumps to it if it exists. If not
a combined topic+content search is started. If the topic matches a "web.topic" pattern then
the topic is searched in the given web. If the topic does not exist in this web the following
topic+content search will be conducted in the web. That is, you can search for content in
a given web using a "web.keyword" pattern.
The search string may be prefixed with a set of options that are separated from the
rest of the search string with a colon(:). Known options are:
| *Option* | *Description* |
| e(dit) | edit the named topic; note, that this does not perform any search operation |
| n(new) | same as =e= but create a new topic, the named topic must not exist |
| g | global search (default is local) |
| l | local search |
| k | do a keyword match |
A search string may consist of a list of terms that are retrieved. If a term shall contain
spaces it can be surrounded by double quotes. Each term may be preceded with a minus (-) to
exclude this term from the hit set.
---++ Examples
| *Search* | *Description* |
| <nop>WikiUsers | if the current web is the %USERSWEB% go to the <nop>WikiUsers |
| g:WikiUsers | list all topics in all webs whose name match "WikiUsers" |
| g:copyright -webpref | list all topics that contain the word "copyright" but not "webpref" |
| g:"Good morning" -natskin | list all topics that contain the term "Good morning" but not "natskin" |
| e:Sandbox.TestTopic411 | edit <nop>Sandbox.TestTopic411 |
| %SYSTEMWEB%.graphics | search for "graphics" in the %SYSTEMWEB% web |
---++ Configuration
<nop>NatSearch can be restricted to certain webs and topics by setting WebPreferences.
Besides the NOSEARCHALL feature of every web that excludes a web from search the following variables
restrict the hit set:
| *Name* | *Description* |
| =NATSEARCHINCLUDEWEB= | a regular expression that must match webs to be considered |
| =NATSEARCHEXCLUDEWEB= | a regular expression that must not match a web |
| =NATSEARCHINCLUDETOPIC= | a regular expression that must match a topic in the hit set |
| =NATSEARCHEXCLUDETOPIC= | a regular expression that excludes a topic from the hit set |
| =NATSEARCHGLOBAL= | 'on' searches in all public webs, \
'off' restricts search to the current web (default), \
same as the =g= option |
| =NATSEARCHKEYWORDS= | 'on' searches for full words only, \
' off' tries to match substrings also (default) |
| =NATSEARCHLIMIT= | limits the number of topics to show, defaults to all |
| =NATSEARCHIGNORECASE= | 'on' or 'off', the default is case insensitive |
| =NATSEARCHTEMPLATE= | configure application-specific search templates topic |
The WebPreferences variable =NATSEARCHTEMPLATE= can be set to a template topic that
is used instead of the skin's =search= template. This can be used in <nop>WikiApplications to
define a customized look of search results.