input

Input "box" in a schema.x.element.form

Description

When the field attribute is specified, this input will be able to translate terms associated with this field in a structured query. If the field attribute is not specified, this will just append a CGI name/value pair to the URL.

If the field-value attribute is specified, only one value will be supported. Queries that are more complex queries than single terms can be translated using this parameter depending on the syntax attribute.

Attributes

  • async (Boolean default: true) - Asynchronous processing. For parse tags, should the request be enqueued (false) or processed before its next sibling. For other elements, this attribute only makes a difference when they contain asynchronous requests which need to be processed before the element is processed. In this case, when false the element's next sibling will only be processed after the current element, when true Watson™ Explorer won't wait for the current element to be processed before processing its next sibling.
  • elt-id (Integer) - Usage: Internal
  • max-elt-id (Integer) - Usage: Internal
  • execute-acl (Text)
  • process (Text) - An XPath determining which of the attributes and/or children will be processed. Currently only "", "*", "@*" and "*|@*" are supported.
  • size
  • cols
  • rows
  • remove-from-new-query
  • display-name
  • name (Text) - The name of the associated CGI parameter
  • value (Text) - A fixed value for this parameter.
  • xpath-value (Text) - XPath post-processing of the value. Use @value to access the value & @name the name of this input (this is interpreted in the context matching a schema.x.element.parse-param before sending the request).
  • field (One of the types: Text) - The field associated with this parameter.
  • field-value (Text) - Specifies a field value which will be the only one supported.
  • syntax (Text) - A space-separated list of schema.x.element.operator names supported in this input.
  • offset (Integer) - When translating a numeric field, add this number to the CGI parameter (particularly useful for the start and page special fields, when the remote source starts counting at 1 instead of 0).
  • next-only (May only be: next-only) - This parameter will only be added for subsequent pages Convenient for site which mark the "next" url with a specific set of parameters which can't be used for the first page.
  • min (Integer) - Minimal value supported for a numeric field.
  • max (Integer) - Maximal value supported for a numeric field.
  • max-instances (Integer) - Maximal number of terms that can be translated in this input.
  • logic (Text default: and) - The default logic supported.
    • all or and: "all words".
    • any or or: "any words".
    • not or none: "none of the words".
    • phrase: "the exact phrase".
    • Empty string: no default logic, only terms will be supported unless operators are specified in the syntax attribute.
  • term-logic (One of the types: NMToken) - Usage: Internal
  • delimiters (Text default: ) - Characters which delimit terms. Watson Explorer uses this information to determine if it necessary to use a phrase operator (i.e., quotes) or not. For example, this can be used to tell Watson Explorer to consider "a'b" as one word and tell Watson Explorer that the remote source will consider this as two words (and will therefore require a phrase operator to consider it as a phrase). The default value (which you can't "see" here because it looks like spaces) is the space, the newline, the tab and the carriage return.
  • word-chars (Text) - By default, when an input supports phrase operators, any term with a non-alpha-numeric character will be surrounded by quotes. This attribute allows you to augment the list of characters considered alpha-numeric.
  • disable-auto-quotes (May only be: disable-auto-quotes) - Turn off the automatic addition of quotes around terms containing non-alpha-numeric characters.
  • position (Integer) - The position of the associated parameter in the URL generated. Certain web applications attach some importance to the order of the CGI parameters. Use this attribute to enforce the order that you would like.
  • priority (Integer default: 0) - The priority with which this input will be used to handle query terms, i.e., if a query term can be supported by multiple input/select, the one with the highest priority will be used.
  • method (Any of: GET, POST, HEAD, GET-POST, POST-XML, POST-SOAP) - The method (GET or POST) by which this parameter will be passed.
  • submit-xml (May only be: submit-xml) - If specified, submit the query element(s) as XML rather than converting them to a string.
  • required (May only be: required) - Do not issue a query to this source if this parameter is not specified.
  • type (Any of: hidden, textarea) - As a convention, followed in the default display, specifies what type of "free-text" form element will be used for display. The default is a regular text input box.
    • hidden: Hidden input
    • textarea: Textarea

Children

  • Choose any number of these in any order.
    • operator: (Zero or more) - Logical operator definition

Examples

Input Example:

  <field name="query" record="record"/>
  <param name="q" value="test"/>
  <form name="vivisimo">
  <input name="q" field="query"/>
  </form>
  <query form="vivisimo"/>

Output Example:

  <param name="q" value="test"/>
  <meta query=" test "/>
  <field name="query" record="record"/>
  <form name="vivisimo">
  <input name="q" field="query"/>
  </form>
  <query>
  <operator logic="and">
  <term field="query" str="test" position="0"/>
  </operator>
  </query>

Input Example:

  <field name="query" record="record"/>
  <field name="title" record="record"/>
  <field name="date"/>
  <operator name="OR" middle-string="OR" logic="or"/>
  <operator name="parenthesis" start-string="(" end-string=")" logic="bracket"/>
  <operator name="AND" middle-string="AND" logic="and" precedence="1"/>
  <operator name="squot" start-string="'" end-string="'" logic="phrase"/>
  <operator name="not" start-string="-" logic="not"/>
  <operator name="title" start-string="title:" field="title"/>
  <operator name="author" end-string="[au]" field="author"/>
  <operator name="date" start-string="[date[" end-string="]]" field="date"/>
  <operator name="near" start-string="{" middle-string="," end-string="}" logic="near"/>
  <param name="query" value="'r s' 't u OR v"/>
  <param name="query" value="-w"/>
  <param name="query" value="x-y"/>
  <param name="query" value="-title:'z a'"/>
  <param name="query" value="b[au] c [au]"/>
  <param name="query" value="[date[d]]"/>
  <param name="query" value="{e,f} {g , h}"/>
  <param name="query" value="-[au] -AND -OR -- "/>
  <param name="query" value="-- "/>
  <form name="f">
  <input name="query" field="query" syntax="OR AND parenthesis wildcard squot not title author date near"/>
  </form>
  <query form="f"/>

Output Example:

  <param name="query" value="'r s' 't u OR v"/>
  <param name="query" value="-w"/>
  <param name="query" value="x-y"/>
  <param name="query" value="-title:'z a'"/>
  <param name="query" value="b[au] c [au]"/>
  <param name="query" value="[date[d]]"/>
  <param name="query" value="{e,f} {g , h}"/>
  <param name="query" value="-[au] -AND -OR -- "/>
  <param name="query" value="-- "/>
  <meta query=" r s 't u  | v w x-y z a b c e f g h [au] AND OR - - "/>
  <field name="query" record="record"/>
  <field name="title" record="record"/>
  <field name="date"/>
  <operator name="OR" middle-string="OR" logic="or"/>
  <operator name="parenthesis" start-string="(" end-string=")" logic="bracket"/>
  <operator name="AND" middle-string="AND" logic="and" precedence="1"/>
  <operator name="squot" start-string="'" end-string="'" logic="phrase"/>
  <operator name="not" start-string="-" logic="not"/>
  <operator name="title" start-string="title:" field="title"/>
  <operator name="author" end-string="[au]" field="author"/>
  <operator name="date" start-string="[date[" end-string="]]" field="date"/>
  <operator name="near" start-string="{" middle-string="," end-string="}" logic="near"/>
  <form name="f">
  <input name="query" field="query" syntax="OR AND parenthesis wildcard squot not title author date near"/>
  </form>
  <query>
  <operator logic="and">
  <term field="query" str="r s" phrase="phrase" position="0"/>
  <term field="query" str="'t" position="1"/>
  <operator name="OR" middle-string="OR" logic="or">
  <term field="query" str="u" position="2"/>
  <term field="query" str="v" position="3"/>
  </operator>
  <operator name="not" start-string="-" logic="not">
  <term field="query" str="w" position="4"/>
  </operator>
  <term field="query" str="x-y" position="5"/>
  <operator name="not" start-string="-" logic="not">
  <term field="title" str="z a" phrase="phrase" position="6"/>
  </operator>
  <term field="author" str="b" position="7" processing="strict"/>
  <term field="author" str="c" position="8" processing="strict"/>
  <term field="date" str="d" position="9"/>
  <operator name="near" start-string="{" middle-string="," end-string="}" logic="near">
  <term field="query" str="e" position="10"/>
  <term field="query" str="f" position="11"/>
  </operator>
  <operator name="near" start-string="{" middle-string="," end-string="}" logic="near">
  <term field="query" str="g" position="12"/>
  <term field="query" str="h" position="13"/>
  </operator>
  <operator name="not" start-string="-" logic="not">
  <term field="query" str="[au]" position="14"/>
  </operator>
  <operator name="not" start-string="-" logic="not">
  <term field="query" str="AND" position="15"/>
  </operator>
  <operator name="not" start-string="-" logic="not">
  <term field="query" str="OR" position="16"/>
  </operator>
  <operator name="not" start-string="-" logic="not">
  <term field="query" str="-" position="17"/>
  </operator>
  <operator name="not" start-string="-" logic="not">
  <term field="query" str="-" position="18"/>
  </operator>
  </operator>
  </query>

Input Example:

  <operator name="any" logic="or"/>
  <field name="query" record="record"/>
  <query>
  <operator logic="and">
  <term str="a" field="query"/>
  <term str="b" field="query"/>
  </operator>
  </query>
  <submit num="50">
  <form action="http://test">
  <input name="i" field="query">
  <operator middle-string="AND" logic="and"/>
  <operator logic="or"/>
  </input>
  </form>
  </submit>
  <submit num="50">
  <form action="http://test">
  <input name="i" field="query" syntax=""/>
  </form>
  </submit>
  <submit num="30">
  <form action="http://test">
  <input name="i" field="query">
  <operator middle-string="AND" logic="and"/>
  </input>
  </form>
  </submit>
  <submit num="20">
  <form action="http://test">
  <input name="i" field="query">
  <operator logic="or"/>
  </input>
  </form>
  </submit>
  <submit num="10">
  <form action="http://test">
  <input name="i" field="query">
  <operator logic="phrase"/>
  </input>
  <input name="j" field="query">
  <operator logic="phrase"/>
  </input>
  </form>
  </submit>

Output Example:

  <meta query=" a b "/>
  <operator name="any" logic="or"/>
  <field name="query" record="record"/>
  <query>
  <operator logic="and">
  <term str="a" field="query"/>
  <term str="b" field="query"/>
  </operator>
  </query>
  <submit num="50" status="translated" last-rank="50" last-page="1">
  <form action="http://test" normalized="normalized" status="trans-succeeded">
  <input name="i" field="query" logic="or" delimiters=" &#13;&#10;&#9;&#x3000;" position="0" value="a AND b">
  <operator middle-string="AND" logic="and"/>
  </input>
  <input field="per"/>
  </form>
  </submit>
  <scope max="50" orig-tag="submit">
  <parse url="http://test/?i=a_AND_b" per="50" page="0" start="0" parser="#vxml#" ref="0"/>
  </scope>
  <submit num="50" status="translated" last-rank="50" last-page="1">
  <form action="http://test" normalized="normalized" status="trans-succeeded">
  <input name="i" field="query" syntax="" logic="and" delimiters=" &#13;&#10;&#9;&#x3000;" position="0" value="a b"/>
  <input field="per"/>
  </form>
  </submit>
  <scope max="50" orig-tag="submit">
  <parse url="http://test/?i=a_b" per="50" page="0" start="0" parser="#vxml#" ref="1"/>
  </scope>
  <submit num="30" status="translated" last-rank="30" last-page="1">
  <form action="http://test" normalized="normalized" status="trans-succeeded">
  <input name="i" field="query" logic="and" delimiters=" &#13;&#10;&#9;&#x3000;" position="0" value="a b">
  <operator middle-string="AND" logic="and"/>
  </input>
  <input field="per"/>
  </form>
  </submit>
  <scope max="30" orig-tag="submit">
  <parse url="http://test/?i=a_b" per="30" page="0" start="0" parser="#vxml#" ref="2"/>
  </scope>
  <submit num="20" status="translation-failed">
  <form action="http://test" normalized="normalized" status="trans-failed">
  <input name="i" field="query" logic="or" delimiters=" &#13;&#10;&#9;&#x3000;" position="0"/>
  </form>
  <contextual-msg name="bad-sub-query">
  <msg time="5" date="1170291631" cputime="0" id="QUERY_NO_CONVERT" function="vivisimo_input_xml" fid="0">The query has not been converted because of sub-query
  <xmlnode>
  <term str="b" field="query"/>
  </xmlnode>
  </msg>
  <term str="b" field="query"/>
  </contextual-msg>
  </submit>
  <submit num="10" status="translated" last-rank="10" last-page="1">
  <form action="http://test" normalized="normalized" status="trans-succeeded">
  <input name="i" field="query" delimiters="" logic="and" position="0" value="a"/>
  <input name="j" field="query" delimiters="" logic="and" position="1" value="b"/>
  <input field="per"/>
  </form>
  </submit>
  <scope max="10" orig-tag="submit">
  <parse url="http://test/?i=a&amp;j=b" per="10" page="0" start="0" parser="#vxml#" ref="3"/>
  </scope>
"or" query conversion

Input Example:

  <field name="query" record="record"/>
  <query>
  <operator logic="or">
  <term str="a" field="query"/>
  <term str="b" field="query"/>
  </operator>
  </query>
  <submit>
  <form action="http://test.com">
  <input name="i" field="query">
  <operator middle-string="OR" logic="or"/>
  <operator logic="and"/>
  </input>
  </form>
  </submit>

Output Example:

  <meta query=" a  | b "/>
  <field name="query" record="record"/>
  <query>
  <operator logic="or">
  <term str="a" field="query"/>
  <term str="b" field="query"/>
  </operator>
  </query>
  <submit status="translated" num="50" last-rank="50" last-page="1">
  <form action="http://test.com" normalized="normalized" status="trans-succeeded">
  <input name="i" field="query" logic="and" delimiters=" &#13;&#10;&#9;&#x3000;" position="0" value="a OR b">
  <operator middle-string="OR" logic="or"/>
  </input>
  <input field="per"/>
  </form>
  </submit>
  <scope max="50" orig-tag="submit">
  <parse url="http://test.com/?i=a_OR_b" per="50" page="0" start="0" parser="#vxml#" ref="0"/>
  </scope>
The first form supporting a query syntax is used for submit. In the following case the second form will be used:

Input Example:

  <query>
  <operator logic="and">
  <term str="ibm.com" field="host"/>
  <term str="ibm.com" field="query"/>
  </operator>
  </query>
  <submit>
  <form action="http://se.com/search?">
  <input name="query" field="query"/>
  </form>
  <form action="http://se.com/advsearch?">
  <input name="query" field="query"/>
  <input name="host" field="host"/>
  </form>
  </submit>

Output Example:

  <meta query=" ibm.com ibm.com "/>
  <query>
  <operator logic="and">
  <term str="ibm.com" field="host" processing="strict"/>
  <term str="ibm.com" field="query" processing="strict"/>
  </operator>
  </query>
  <submit status="translated" num="50" last-rank="50" last-page="1">
  <form action="http://se.com/search?" normalized="normalized" status="trans-failed">
  <input name="query" field="query" logic="and" delimiters=" &#13;&#10;&#9;&#x3000;" position="0"/>
  </form>
  <form action="http://se.com/advsearch?" normalized="normalized" status="trans-succeeded">
  <input name="query" field="query" logic="and" delimiters=" &#13;&#10;&#9;&#x3000;" position="0" value="ibm.com"/>
  <input name="host" field="host" logic="and" delimiters=" &#13;&#10;&#9;&#x3000;" position="1" value="ibm.com"/>
  <input field="per"/>
  </form>
  </submit>
  <scope max="50" orig-tag="submit">
  <parse url="http://se.com/advsearch?query=ibm.com&amp;host=ibm.com" per="50" page="0" start="0" parser="#vxml#" ref="0"/>
  </scope>