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 |
---|
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 == |
---|
| 12 | All 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) |
---|
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 == |
---|
| 21 | The 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 | }}} |
---|
| 32 | The empty result is returned if nothing is found: |
---|
| 33 | {{{ |
---|
| 34 | <result/> |
---|
| 35 | }}} |
---|
| 36 | In 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 | |
---|
| 43 | The module results are returned by modules in two different forms: XML and HTML. |
---|
| 44 | |
---|
| 45 | == XML Results == |
---|
| 46 | The 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 | |
---|
| 51 | The response to following search request: |
---|
| 52 | {{{ |
---|
| 53 | http://adei_server.net/adei/services/search.php?search_module=item&search=temperature |
---|
| 54 | }}} |
---|
| 55 | returns 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&db_name=detector&db_group=0&db_mask=72"/> |
---|
| 61 | <Value title="412-RTP-5-0012" props="db_server=katrin&db_name=detector&db_group=0&db_mask=75/"> |
---|
| 62 | ... |
---|
| 63 | </result> |
---|
| 64 | </module> |
---|
| 65 | </result> |
---|
| 66 | }}} |
---|
| 67 | The '''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 | |
---|
| 69 | Another example uses the ''interval'' search module to find the UNIX timestamps of the entered textual date |
---|
| 70 | {{{ |
---|
| 71 | http://adei_server.net/adei/services/search.php?search=January 2005 |
---|
| 72 | }}} |
---|
| 73 | The '''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 | }}} |
---|