Query Syntax Help

This document gives an overview of how to perform advanced searches in UB Search using different query operators.

Simple query

This is just a simple sequence of words.

distinguished speaker series

A full answer to this query would show pages that contain the terms distinguished, speaker and series. 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.

"distinguished speaker series"

Answers to this query will contain the exact phrase "distinguished speaker series". No partial matches will occur.

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

class:query

The query:

author:smith

locates documents containing the word smith within the metadata field corresponding to the metadata class "author".

Some more metadata search examples:
  • campus:north Greiner
  • eventbuilding:capen
  • language:spanish
  • peopleDepartment:mgt
  • peopleTitle:associate
  • poicategory:dining

Some searchable general metadata classes: t (title), d (date), language

Some searchable events metadata classes: campus, eventbuilding

Some searchable people metadata classes: peopleUBIT, peopleTitle, peoplePhone, peopleLastName, peopleDepartment

Some searchable events metadata classes: campus, poicategory

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.

Negation operator

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

Smith !Frank

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

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.

Smith -Frank

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

Mandatory inclusion operator

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

Ben +Jerry

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

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. Initially, the index is reduced to only those documents containing anthony and cleopatra. Then the query is run on the reduced index. Therefore, every result will contain the word antony and cleopatra. A partial match with include antony and cleopatra, and either rome or octavius.

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 a set of OR-ed 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.

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

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, UB Search 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<8aug2019

This query returns documents that were modified/created before the 8th of August 2019.

Date operators are >, <, =

Stemming

Stemming is the process of reducing words to a common stem and allowing the search to match different variants of the word based on the common word stem.

By default UB Search 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

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