Consider that the following set of CGI parameters has been specified by the user through an HTML form:
num=100 v:project=tutorial1 v:sources=SITE1 v:sources=SITE2 input-form=tutorial-form query="document clustering" OR auto-categorization site=vivisimo.com
These parameters are processed as follows by the query-meta CGI script:
Setting variables or options from CGI parameters is done in the main macro using the Watson Explorer Engine XML Tutorial: Syntax. Here is the XML code that sets the query.input-form variable:
<if-var name="form" realm="param">
<set-var name="render.form">
<value-of-var name="form" realm="param" />
</set-var>
</if-var>
See the The 'Main' Variable and Associated Macro for more details.
<input size="50" name="query" field="query" syntax="AND and () + NOT - OR or quotes host title" logic="all" /> <input name="site" field="host" logic="phrase" />
This interprets the query and site CGI parameter as matching, and by default the query and host fields. Given that the OR and quotes operators are supported by the query input box, converting the parameters based on this input form will therefore generate the following structured query:
<query>
<operator logic="and">
<operator logic="or">
<term field="query" str="auto-categorization" />
<term field="query" str="document clustering" />
</operator>
<term field="host" str="vivisimo.com" />
</operator>
</query>
The same query could have been created by entering the following in the query input box because it supports the host operator:
"document clustering" OR auto-categorization host:vivisimo.com title:product
The SITE1 form would contain the following inputs:
<input name="q" syntax="AND () NOT OR quotes" logic="all" / <input name="dom" field="host" />
Using this form, the structured query above can be translated into:
q="document clustering" OR auto-categorization dom=vivisimo.com
The SITE2 form would contain the following input:
<input name="q" syntax="- OR quotes filetype site" logic="all"</input>
The structured query above can be translated using this form into:
q="document clustering" OR auto-categorization site:vivisimo.com
If the SITE1 form did not have the dom input, it would not have been able to translate the term associated with the host field. In that case, the query would not have been forwarded to SITE1.
The next sections give a more detailed overview on the different components involved in this query conversion process. For information on forms, click Input Forms.