data/TWiki/TWikiSearchDotPm.txt,v
changeset 0 414e01d06fd5
equal deleted inserted replaced
-1:000000000000 0:414e01d06fd5
       
     1 head	1.3;
       
     2 access;
       
     3 symbols;
       
     4 locks; strict;
       
     5 comment	@# @;
       
     6 
       
     7 
       
     8 1.3
       
     9 date	2008.01.22.03.21.31;	author TWikiContributor;	state Exp;
       
    10 branches;
       
    11 next	1.2;
       
    12 
       
    13 1.2
       
    14 date	2007.01.16.04.12.02;	author TWikiContributor;	state Exp;
       
    15 branches;
       
    16 next	1.1;
       
    17 
       
    18 1.1
       
    19 date	2006.02.01.12.01.25;	author TWikiContributor;	state Exp;
       
    20 branches;
       
    21 next	;
       
    22 
       
    23 
       
    24 desc
       
    25 @new-topic
       
    26 @
       
    27 
       
    28 
       
    29 1.3
       
    30 log
       
    31 @buildrelease
       
    32 @
       
    33 text
       
    34 @---+ Package =TWiki::Search=
       
    35 
       
    36 This module implements all the search functionality.
       
    37 
       
    38 
       
    39 %TOC%
       
    40 
       
    41 ---++ ClassMethod *new* <tt>($session)</tt>
       
    42 
       
    43 Constructor for the singleton Search engine object.
       
    44 
       
    45 
       
    46 
       
    47 ---++ ObjectMethod *finish* <tt>()</tt>
       
    48 Break circular references.
       
    49 
       
    50 
       
    51 
       
    52 ---++ StaticMethod *getTextPattern* <tt>($text,$pattern)</tt>
       
    53 
       
    54 Sanitise search pattern - currently used for FormattedSearch only
       
    55 
       
    56 
       
    57 
       
    58 ---++ ObjectMethod *searchWeb* <tt>(...)</tt>
       
    59 
       
    60 Search one or more webs according to the parameters.
       
    61 
       
    62 If =_callback= is set, that means the caller wants results as
       
    63 soon as they are ready. =_callback_ should be set to a reference
       
    64 to a function which takes =_cbdata= as the first parameter and
       
    65 remaining parameters the same as 'print'.
       
    66 
       
    67 If =_callback= is set, the result is always undef. Otherwise the
       
    68 result is a string containing the rendered search results.
       
    69 
       
    70 If =inline= is set, then the results are *not* decorated with
       
    71 the search template head and tail blocks.
       
    72 
       
    73 The function will throw Error::Simple if it encounters any problems with the
       
    74 syntax of the search string.
       
    75 
       
    76 Note: If =format= is set, =template= will be ignored.
       
    77 
       
    78 Note: For legacy, if =regex= is defined, it will force type='regex'
       
    79 
       
    80 If =type="word"= it will be changed to =type="keyword"= with =wordBoundaries=1=. This will be used for searching with scope="text" only, because scope="topic" will do a Perl search on topic names.
       
    81 
       
    82 SMELL: If =template= is defined =bookview= will not work
       
    83 
       
    84 SMELL: it seems that if you define =_callback= or =inline= then you are
       
    85 	responsible for converting the TML to HTML yourself!
       
    86 	
       
    87 FIXME: =callback= cannot work with format parameter (consider format='| $topic |'
       
    88 
       
    89 
       
    90 
       
    91 ---++ StaticMethod *displayFormField* <tt>($meta,$args) -> $text</tt>
       
    92 
       
    93 Parse the arguments to a $formfield specification and extract
       
    94 the relevant formfield from the given meta data.
       
    95 
       
    96    * =args= string containing name of form field
       
    97 
       
    98 In addition to the name of a field =args= can be appended with a commas
       
    99 followed by a string format (\d+)([,\s*]\.\.\.)?). This supports the formatted
       
   100 search function $formfield and is used to shorten the returned string or a 
       
   101 hyphenated string.
       
   102 
       
   103 
       
   104 @
       
   105 
       
   106 
       
   107 1.2
       
   108 log
       
   109 @buildrelease
       
   110 @
       
   111 text
       
   112 @d14 5
       
   113 d40 3
       
   114 d47 2
       
   115 d57 14
       
   116 @
       
   117 
       
   118 
       
   119 1.1
       
   120 log
       
   121 @buildrelease
       
   122 @
       
   123 text
       
   124 @d35 1
       
   125 a35 1
       
   126 SMELL: If =format= is set, =template= will be ignored.
       
   127 d37 1
       
   128 a37 1
       
   129 SMELL: If =regex= is defined, it will force type='regex'
       
   130 @