Skip to content

Query operators

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 the terms+term1 +term2
_notnegate the terms-term1 -term2
_oror the terms[term1 term2]
_orsandor with scoped and|[term1 term2]
_phrasephrase"term1 term2"
_proxproximity`term1 term2`
_sandscoped and|term1 |term2
_truncword truncation*term1* *term2*

Note:

  • Word truncation is supported only when the -service_volume=low query processor option is set, or term at a time mode is used (-daat=0).
  • Scoped and/or (sand and orsand) terms pre-scope the query and do not count towards partial matches. This means that all the results will include the pre-scoped values, then the other terms will be used for partial matches.

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

Funnelback logo
v15.12.0