Skip to content

Query language help

Introduction

This document gives an overview of how to perform advanced searches in Funnelback using different query operators. It lists the available query types and gives a link to an example results page for each one.

Simple query

This is just a simple sequence of words - described in the simple search document.

julius caesar rome

A full answer to this query would show pages that contain the terms julius, caesar and rome. Partially-matching answers would only need to contain one of these terms.

Phrase operator

A phrase query can be specified by putting quote characters ("") around your query words. Using the phrase operator specifies that the component words must appear consecutively and in the order specified. Note that intervening punctuation, HTML tags etc will be ignored.

"hail caesar"

Answers to this query will contain the exact phrase "hail caesar". No partial matches will occur.

The phrase operator is equivalent to the query_phrase CGI parameter. e.g. query_phrase=hail+caesar

Documents may contain metadata, including the document's author, title and when it was created. Funnelback can query this information using the syntax:

class:query

where class is the metadata class as defined in the collection's metadata mappings.

The query:

city:barcelona

locates documents containing the word barcelona within the metadata field corresponding to the metadata class "city".

The metadata operator is equivalent to the meta_X CGI parameter. e.g. &meta_city=barcelona

See: searching text metadata for more information.

Dysjunction (OR) operator

The dysjunction operator acts like an OR in a Boolean language. The results will contain any document that has at least one of the query terms. For example:

[mighty brave] army

A full answer to this query will include the word army and one or more of mighty or brave.

The dysjunction operator is equivalent to the query_or CGI parameter e.g. &query_or=mighty+brave&query=army

Negation operator

The negation operator excludes all documents that contain the negated query from the fully matching results.

caesar !brutus

A full answer to this query will include the word caesar but no occurrence of the word brutus. Unlike the mandatory exclusion operator (see below), partial results presented in subsequent result tiers may contain the word brutus.

Mandatory exclusion operator

The mandatory exclusion operator excludes all documents that contain the negated query from all results. This is similar to the NOT operator in a Boolean language.

caesar -antony

A full answer to this query will include the word caesar but no occurrence of the word antony. Unlike the negation operator (see above), no results will contain the word antony in the indexable part of the text. The partial results are those which satisfy the mandatory constraint (no antony) but which do not contain caesar.

The mandatory exclusion operator is equivalent to the query_not CGI parameter. e.g. query=caesar&query_not=antony

Mandatory inclusion operator

The mandatory inclusion operator will return results that all have the included terms.

antony +cleopatra

A full answer to this query will include the words antony and cleopatra. Every result will contain the word cleopatra.

The mandatory inclusion operator is equivalent to the query_and CGI parameter. e.g. query=antony&query_and=cleopatra

Scoped mandatory inclusion operator (scoped AND)

Scoped operators cause the index to be scoped and don't count as query parameters. The scoping reduces the index to include only documents containing the scoped items, then the rest of the query is run on the scoped index. This means that the scoped operators don't count towards partial matches and that other query parameters are required for results to be returned as the scoping just defines the overall set of pages that can be included in a result set.

rome octavius |antony |cleopatra 

A full answer to this query will include all four words rome. Every result will contain the word antony and cleopatra. A partial match with include antony and cleopatra, and either rome or octavius.

The scoped mandatory inclusion operator is equivalent to the query_sand CGI parameter. e.g. query=rome+octavius&query_sand=antony+cleopatra

Scoped mandatory inclusion with dysjunction operator (OR with scoped AND)

Similar to the scoped AND, this pre-scopes the index to include only items that match match a set of ORed terms.

rome octavius |[antony cleopatra]

A full answer to this query will include rome and octavius and one or both of antony and cleopatra. Every result will contain the word antony or cleopatra. A partial match with include antony and/or cleopatra, and either rome or octavius.

The scoped mandatory inclusion with dysjunction operator is equivalent to the query_orsand CGI parameter. e.g. query=rome+octavius&query_orsand=antony+cleopatra

Near (proximity) operator

The near operator (backquotes) requires that the query words appear, in any order, within 15 words of each other. The Funnelback administrator can adjust this limit to any number of words.

`army march`

The full answer to this query will be those documents that include the word army within 15 words of march (in any order).

The near operator is equivalent to the query_prox CGI parameter. e.g. query_prox=army+march

Up-weight operator

The up-weight operator (tilde) will increase the score of documents that match the element without making this element a constraint. For example:

computer science course ~concurrency 

The full answer to this query will be those documents that include the words computer,science and course, however documents that have the term concurrency will be given higher scores.

A weighting can be set by appending the weight using a carat operator. For example:

computer science course ~concurrency^0.9 

Date query

Date queries constrain the result set to documents that were modified/created during a specified time period. For date querying purposes, Funnelback only records one date per document. It will look for the date modified, the date created and the HTTP server's last modified date (in that order).

d<1jan1600

This query returns documents that were modified/created before the 1st of January 1600.

Several date CGI parameters can be used to handle a date query. e.g. meta_d2=1Jan1600

Stemming

By default Funnelback stems words in both the query and in the index. However, if it is disabled in the query processor options, you also can specify stemming by appending a cross-hatch ('#') to each query word you wish to stem.

For example, the query:

economic# policy#

will match:

  • economic policy
  • economics policy
  • economic policies

Truncation operator

Please note:

  • The truncation operator is supported in term at a time mode, only when either the -service_volume=low or -daat=0query processor option is set.
  • Enabling term at a time mode disables many newer Funnelback features.
  • Truncation is an expensive operation and can significantly impact the search response time.
  • The knowledgebase article: Adding limited wildcard support to DAAT mode provides a method for adding limited truncation support to the newer document at a time mode.

The truncation operator matches pages containing words that contain variants of the query term matching the wildcard.

anti*

This example pattern matches all pages containing words starting with anti, such as antium and antioch. Be careful, there are almost always more matching words than you expect, resulting in more matching pages.

The truncation operator can appear at the left, at the right or both, but NOT in the middle of the string.

*och*

This example pattern matches all pages with words containing the string och, such as antioch and rochester.

The truncation operator is equivalent to the query_trunc CGI parameter. e.g. query_trunc=*och*

Complex examples

Mixed operators

The query:

t:`war castle` |england

mixes the following operators:

  • metadata: search for document titles (t);
  • proximity: titles containing the query terms close to each other (in any order); and
  • scoped to pages that include the word england

See also

top

Funnelback logo
v15.24.0