Changes from Version 1 of adeiSEARCH/String

Show
Ignore:
Author:
csa (IP: 141.52.232.84)
Timestamp:
09/14/09 00:48:44 (15 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • adeiSEARCH/String

    v0 v1  
     1=== Format of search string === 
     2The search string consists of four components: 
     3 * The first component defines type of the search. Examples are ''item search'', ''channel value search'', ''datetime search''. 
     4 * Second component provides some options. For example, demands exact or fuzzy match 
     5 * Third and fourth components are type-dependent and containing search string and additional limits 
     6 
     7'''I''': The format is as follows: 
     8  {{{ [type/module specification] [global flags] <search string> [limits] }}} 
     9Everything besides search string is optional. By default if the type is not specified, the search string is analyzed. Analysis routine guesses the type of search and executes a default set of modules for this type. The default behavior is to search for channel and group names. See [wiki:adeiSEARCH#StringAnalysis String Analysis ] section for details. 
     10 
     11The search type is specified in the curly brackets in the beginning of the search string. The search module available in the ''classes/search'' should be indicated (name of the class should be specified). Optional options for the class constructor could be indicated as well. If multiple modules are specified, the multiple searches are performed sequentially. The following format is expected: 
     12  {{{ {module_name(opt1=value1,opt=value2), another_module(...)} }}} 
     13 
     14'''II''': The global options are going next to the search type and specified in the square brackets. This options then passed to the search modules with the search string and handled by the module code. The following options are supported: 
     15 * ''='' - Exact match, this means what the search string is matched completely without splitting into the phrases 
     16 * ''w'' - Word match, if not overridden by match modifiers, see below  
     17 * ''~'' - Fuzzy match, if not overridden by match modifiers, see below 
     18 
     19'''III''': Then the search string is follows. If the ''Exact match'' flag is not specified, it consists of the phrases. The phrase is 
     20 * words consisting of alphanumeric symbols, dash and underscore symbols (''-'',''_'') 
     21 * multiple words enclosed in singular or double quotes('") 
     22 * regular expressions enclosed in ''/'' from both ends 
     23 
     24This is an example of a search string consisting of 4 components: two words, one phrase, and a regular expression: 
     25{{ 
     26{word1 word2 "phrase 3" /regexp/ 
     27}}} 
     28 
     29Before each phrase, a match modifier could be specified. The following match modifiers are supported 
     30 * if no modifier is specified, the phrases starting from search term will be matched 
     31 * ''='' - full match, the whole words are matched 
     32 * ''~'' - fuzzy match, any part of a word could be matched 
     33 
     34Please consider following example to understand the meaning of match modifiers. By default if a search for '''sin''' is performed the words '''sin''' and '''sinus''' will be matched, but ''cosinus'' - not. However, if a fuzzy search is given ('''~sin'''), the '''cosinus''' will be matched as well. On other hand if a full match is required ('''=sin'''), only '''sin''' will be matched. Both '''sinus''' and '''cosinus''' will be rejected. 
     35 
     36The match of each phrase against data records produces ratings from ''0'' to ''1'' indicating match quality. The value ''0'' means what the record is not matched and value ''1'' indicates a full match. If several phrases are listed in search string, the ratings of each phrase match are multiplied to produce overall rating. For example, if phrase1 matched with rating ''0.70'', phrase2 matched with rating ''0.30'' and word3 is fully matched, the overall rating would be: 0.21 = 0.70 * 0.30 * 1. 
     37 
     38Rating computation could be altered using unary and binary operations. Lets assume what ''[word]'' is a rating of ''word'', then the ratings of these operations are computed as follows: 
     39 * ''! word'' - The resulting rating would be 1 - [word] 
     40 * ''+ word'' - The rating below 1 will be cat to 0 
     41 * ''- word'' - All non-zero ratings will be cut to zero, and zero rating will be replaced with 1 
     42 * ''(word1|word2)'' - The maximal rating amongst [word1] and [word2] 
     43 
     44Few examples of complex search strings: 
     45{{{ 
     46=sinus | cos1 
     47}}} 
     48{{{ 
     49!"a b c" ~d -e +('f g' !(!i (k))) "m n" 
     50}}} 
     51 
     52'''IV''': On-or-more limits can be set in the last part of the search string. The following format is expected 
     53{{{ 
     54 limit_name:limit_value another_limit:another_limit_value 
     55}}} 
     56 
     57The limits handling is completely module specific. Example: 
     58{{{ 
     59+sinus | cos1 interval:2006 
     60}}}