Funnelback logo

Documentation

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:

Modifier Description Query expression
_and And's the terms +term1 +term2
_not Negates the terms -term1 -term2
_or Or [ term1 term2 ]
_orsand Or with scoped And |[ term1 term2 ]
_phrase Phrase "term1 term2"
_prox Proximity `term1 term2`
_sand Scoped And |term1 |term2
_trunc Word truncation *term1* *term2*

Example 1: Simple phrase search

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

<label for="query_phrase">Search:</label></b>
<input id="query_phrase"
       type="text" name="query_phrase" size="20"
       value="<s:cgi>query_phrase</s:cgi>">

Example 2: Funnelback "advanced" search form

The following HTML is from a sample Funnelback advanced search form. It provides 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 ).
      <!-- all the words -->
      <dt class="inputlabel">
          <label for="query_and">All the words:</label>
      </dt>
      <dd class="inputfield">
          <input type="text"
                 id="query_and"
                 name="query_and"
                 size="20"
                 value="<s:cgi>query_and</s:cgi>">
      </dd>

      <!-- the phrase -->
      <dt class="inputlabel">
          <label for="query_phrase">The phrase:</label>
      </dt>
      <dd class="inputfield">
          <input type="text"
                 id="query_phrase"
                 name="query_phrase"
                 size="20"
                 value="<s:cgi>query_phrase</s:cgi>">
      </dd>

      <!-- any of the words -->
      <dt class="inputlabel">
          <label for="query_or">Any of the words:</label>
      </dt>
      <dd class="inputfield">
          <input type="text"
                 id="query_or"                        
                 name="query_or"
                 size="20"
                 value="<s:cgi>query_or</s:cgi>">
      </dd>

      <!-- none of the words -->
      <dt class="inputlabel">
          <label for="query_not">None of the words:</label>
      </dt>
      <dd class="inputfield">
      <input type="text"
             id="query_not"
             name="query_not"
             size="20"
             value="<s:cgi>query_not</s:cgi>">
      </dd>

See also

top ⇑