Changes between Version 3 and Version 4 of adeiService_search

Show
Ignore:
Author:
csa (IP: 141.52.232.84)
Timestamp:
09/11/09 03:48:31 (15 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • adeiService_search

    v3 v4  
    1 = Search = 
     1= search = 
    22 
    3  Service performs searches for various information in ADEI and source databases
     3Service performs searches for various information in ADEI and source databases. ADEI has a modular [wiki:adeiSEARCH SEARCH SubSystem]. The search capabilities are provided by the search engines which providing one-or-more search modules. The understanding of the subsystem is mandatory to use the service
    44 
    5 === Format of search string === 
    6 The search string consists of four components: 
    7  * The first component defines type of the search. Examples are ''item search'', ''channel value search'', ''datetime search''. 
    8  * Second component provides some options. For example, demands exact or fuzzy match 
    9  * Third and fourth components are type-dependent and containing search string and additional limits 
     5== Mandatory Properties == 
     6 * [wiki:adeiParam_search search] - A search string, could include the list of search modules along with parameters 
    107 
    11 The format is as follows: 
    12   {{{ [type/module specification] [global flags] <search string> [limits] }}} 
    13 Everything besides search string is optional. By default if the type is not specified, the search for channel and group names is performed. 
     8== Optional Properties == 
     9 * [wiki:adeiParam_search_modules search_modules] - A list of search modules to perform search along with parameters. If modules are specified in ''search'' property as well, the module specified in ''search'' take precedence. If the search modules are neither specified in the ''search_modules'' nor in the ''search'' string. the search string would be analyzed. Analysis routine is guessing the type of search and executes a default set of modules for that type. 
    1410 
    15 The 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: 
    16   {{{ {module_name(opt1=value1,opt=value2), another_module(...)} }}} 
     11== Additional Properties == 
     12All standard data source / time interval properties can be taken into the account by search modules. For example, they can sort the found result putting the results from currently selected data source first. The searching only within the currently selected group is another possible example. 
     13 * [wiki:adeiParam_db_server db_server ] - Data source / system 
     14 * [wiki:adeiParam_db_name db_name ] - Database name 
     15 * [wiki:adeiParam_db_group db_group ] - Log Group 
     16 * [wiki:adeiParam_control_group control_group ] - Control Group 
     17 * [wiki:adeiParam_experiment experiment ] - The current experiment/run duration 
     18 * [wiki:adeiParam_window window] - Data Interval (everything by default) 
    1719 
    18 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: 
    19  * ''='' - Exact match, default behavior is to match  
    20  * ''w'' - Word match 
    21  * ''~'' - Fuzzy match 
     20== Returned Result == 
     21The XML document with results found by all used modules. If certain module have produced no results it is not included in the output. The following format is used: 
     22{{{ 
     23<result> 
     24  <module name="item" title="Items"> 
     25     ... module results, see the description below ... 
     26  </module> 
     27  <module name="groups" title="Log Groups"> 
     28     ... module results, see the description below ... 
     29  </module> 
     30  ... 
     31}}} 
     32The empty result is returned if nothing is found: 
     33{{{ 
     34<result/> 
     35}}} 
     36In the case of error, the error message in the following format is returned: 
     37{{{ 
     38<result> 
     39 <Error>Unknown control_group (0) is specified</Error> 
     40</result> 
     41}}} 
     42 
     43The module results are returned by modules in two different forms: XML and HTML. 
     44 
     45== XML Results == 
     46The most modules are returning the results in the XML format. Each result is returned in ''Value'' XML node and all ''Value'' nodes are enclosed in the ''result'' node. The ''Value'' node includes several attributes: 
     47 * ''title'' - describing the result 
     48 * ''props'' - URL encoded string with parameters to adjust in the ADEI system, if this result is selected 
     49 * ''certain'' - This optional property is indicating what the ADEI is certain about this result 
     50 
     51The response to following search request: 
     52{{{ 
     53 http://adei_server.net/adei/services/search.php?search_module=item&search=temperature 
     54}}} 
     55returns all items which names are started with "temperature": 
     56{{{ 
     57<result> 
     58  <module name="item" title="Items"> 
     59     <results> 
     60        <Value  title="412-RTP-5-0011" props="db_server=katrin&amp;db_name=detector&amp;db_group=0&amp;db_mask=72"/> 
     61        <Value  title="412-RTP-5-0012" props="db_server=katrin&amp;db_name=detector&amp;db_group=0&amp;db_mask=75/"> 
     62        ... 
     63     </result> 
     64  </module> 
     65</result> 
     66}}} 
     67The '''props''' property in this case defines ''db_server'', ''db_name'', ''db_group'', and ''db_mask'' properties which are fully describing the result. If these properties are passed to the ADEI system, the found item will be displayed. 
     68 
     69Another example uses the ''interval'' search module to find the UNIX timestamps of the entered textual date 
     70{{{ 
     71http://adei_server.net/adei/services/search.php?search=January 2005 
     72}}} 
     73The '''props''' in this case contains ''window'' property which should be passed to ADEI system to limit the data a single month in year 2005. 
     74{{{ 
     75<result> 
     76  <module name="interval" title="Dates"> 
     77     <results> 
     78        <Value  title="Jan 1, 2009 00:00:00 - Feb 1, 2009 00:00:00" props="window=1230768000-1233446400" certain="1"/> 
     79     </result> 
     80  </module> 
     81</result> 
     82}}} 
    2283 
    2384 
     85== HTML Results ==