term

A "leaf" in a structured query

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.
  • field (Text) - The field this term belongs to.
  • str (Text) - String value carried by the term.
  • count (Integer) - Usage: Internal
  • weight (Decimal number) - A weight assigned to the term for possible biasing of the search ranking.
  • phrase (May only be: phrase) - Usage: Internal
  • processing ( If a field is strict, a structured query having terms in this field will not be forwarded to a source whose form does not support it. If a field is optional, the query will be forwarded even if the field is not supported. Any of: strict, optional, special)
  • position (Integer) - This value is added automatically to term nodes to reflect the ordering of terms as entered in the user's query. The position is then used during query translation to assure the order of terms is the same when sending the query to the search engine being queried.
  • input-type (Any of: system, user) - Indicates the type of the field (for easier post-processing of the query). System fields should generally be ignored during post-processing.
  • logic (Any of: phrase, and, near, or) - If the term's str attribute is tokenized/segmented to more than a single token, this logic will be used to connect the individual tokens. If not specified, the collection's value for the term logic option will be used (which defaults to phrase). Usage: Search engine module only
  • str-type (Any of: text, html) - Specifies the type of the str attribute. If HTML then < and & must be written as < and & whereas < can be used to potentially search HTML tags. Usage: Search engine module only
  • changed (May only be: changed) - Indicates that the term was modified by a form of query modification.

Children

  • Use these in the listed order. The sequence may not repeat.
    • 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:

  <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>