1 # <a name="Package <code>TWiki::Search="></a> Package =TWiki::Search
3 This module implements all the search functionality.
7 <li><a href="#Package =TWiki::Search="> Package TWiki::Search</a><ul>
8 <li><a href="#ClassMethod <strong>new</strong> ($session)"> ClassMethod new <tt>($session)</tt></a></li>
9 <li><a href="#StaticMethod <strong>get_TextPattern</strong> ("> StaticMethod getTextPattern <tt>($text,$pattern)</tt></a></li>
10 <li><a href="#ObjectMethod <strong>searchWeb</strong> (...)"> ObjectMethod searchWeb <tt>(...)</tt></a></li>
16 ## <a name="ClassMethod <strong>new</strong> ($session)"></a> [[ClassMethod]] **new** `($session)`
18 Constructor for the singleton Search engine object.
20 ## <a name="StaticMethod <strong>get_TextPattern</strong> ("></a> [[StaticMethod]] **getTextPattern** `($text,$pattern)`
22 Sanitise search pattern - currently used for [[FormattedSearch]] only
24 ## <a name="ObjectMethod <strong>searchWeb</strong> (...)"></a> [[ObjectMethod]] **searchWeb** `(...)`
26 Search one or more webs according to the parameters.
28 If `_callback` is set, that means the caller wants results as soon as they are ready. =\_callback\_ should be set to a reference to a function which takes `_cbdata` as the first parameter and remaining parameters the same as 'print'.
30 If `_callback` is set, the result is always undef. Otherwise the result is a string containing the rendered search results.
32 If `inline` is set, then the results are **not** decorated with the search template head and tail blocks.
34 SMELL: If `format` is set, `template` will be ignored.
36 SMELL: If `regex` is defined, it will force type='regex'
38 SMELL: If `template` is defined `bookview` will not work
40 SMELL: it seems that if you define `_callback` or `inline` then you are responsible for converting the TML to HTML yourself!
42 FIXME: `callback` cannot work with format parameter (consider format='| $topic |'