Query Operator

Introduction

Funnelback's query language supports a number of query operators that can be used to enhance a query. The operators modify the name of the CGI query parameters. For example,

query_prox=romeo+juliet

is a proximity query: romeo juliet.

The full list of modifiers is:

ModifierDescriptionQuery expression
_andAnd's the terms+term1 +term2
_notNegates the terms-term1 -term2
_orOr[term1 term2]
_orsandOr with scoped And|[term1 term2]
_phrasePhrase"term1 term2"
_proxProximity\term1 term2``
_sandScoped And|term1 |term2
_truncWord truncation\*term1\* \*term2\*

Please note - Word truncation is supported only when the -service_volume=low query processor option is set

This Funnelback template snippet will display a HTML input box that allows the user to search for a particular phrase (via the _phrase modifier).

...
<label for="query_phrase">Search:</label>
<input id="query_phrase"
       type="text" name="query_phrase"
       value="${question.inputParameterMap["query_phrase"]!?html}"
       placeholder="e.g. to be or not to be">
...

Example 2: Funnelback "advanced" search form

The following template snippet is from a sample Funnelback advanced search form. It provides HTML for four text boxes for the user to enter terms to find:

  • all the words ( _and );
  • a phrase ( _phrase );
  • any of the words ( _or );
  • none of the words ( _not ).
 ...
    <dl>
      <!-- all the words -->
      <dt>
          <label for="query_and">All the words:</label>
      </dt>
      <dd>
          <input type="text"
                 id="query_and"
                 name="query_and"
                 value="${question.inputParameterMap["query_and"]!?html}">
      </dd>

      <!-- the phrase -->
      <dt>
          <label for="query_phrase">The phrase:</label>
      </dt>
      <dd>
          <input type="text"
                 id="query_phrase"
                 name="query_phrase"
                 value="${question.inputParameterMap["query_phrase"]!?html}">
      </dd>

      <!-- any of the words -->
      <dt>
          <label for="query_or">Any of the words:</label>
      </dt>
      <dd>
          <input type="text"
                 id="query_or"                        
                 name="query_or"
                 value="${question.inputParameterMap["query_or"]!?html}">
      </dd>

      <!-- none of the words -->
      <dt>
          <label for="query_not">None of the words:</label>
      </dt>
      <dd>
      <input type="text"
             id="query_not"
             name="query_not"
             value="${question.inputParameterMap["query_not"]!?html}">
      </dd>
    </dl>
   ...

See also

top