Complex Searches Syntax

description of the syntax for using complex searches in a Full Text mode

Overview

This page describes the syntax that you can use to start research "Full Text". The Full Text Search refers to those techniques to search for a document based on the control of words, trying to find a match according to certain criteria provided by the user.

Terms

A query is broken up into terms and operators. There are two types of terms: Single Terms and Phrases.
A Single Term is a single word such as "debt" or "public".
A Phrase is a group of words surrounded by double quotes such as "public debt".
Multiple terms can be combined together with Boolean operators to form a more complex query. The research will be conducted between the search terms and any word in the sentence, giving more importance to the results that largely satisfy the query searched.

Wildcard Searches

FullText supports single and multiple character wildcard searches within single terms (not within phrase queries).
To perform a single character wildcard search use the "?" symbol.
To perform a multiple character wildcard search use the "*" symbol.
The single character wildcard search looks for terms that match that with the single character replaced. For example, to search for "text" or "test" you can use the search:
te?t
Multiple character wildcard searches looks for 0 or more characters. For example, to search for test, tests or tester, you can use the search: test*
You can also use the wildcard searches in the middle of a term: te*t
Note: You cannot use a * or ? symbol as the first character of a search.

Boosting a Term

FullText provides the relevance level of matching documents based on the terms found. To boost a term use the caret, "^", symbol with a boost factor (a number) at the end of the term you are searching. The higher the boost factor, the more relevant the term will be. Boosting allows you to control the relevance of a document by boosting its term. For example, if you are searching for
bollettino APC
and you want the term "APC" to be more relevant boost it using the ^ symbol along with the boost factor next to the term. You would type:
bollettino APC^5
This will make documents with the term APC appear more relevant. You can also boost Phrase Terms as in the example:
bollettino APC^3 "poi APC"^5
By default, the boost factor is 1. Although the boost factor must be positive, it can be less than 1 (e.g. 0.2)

Boolean Operators

Boolean operators allow terms to be combined through logic operators. FullText supports AND, "+", OR, NOT and "-" as Boolean operators.
Note: Note: Boolean operators must be ALL CAPS.

OR

The OR operator is the default conjunction operator. This means that if there is no Boolean operator between two terms, the OR operator is used. The OR operator links two terms and finds a matching document if either of the terms exist in a document. This is equivalent to a union using sets. The symbol || can be used in place of the word OR.
To search for documents that contain either "pesce gatto" or pesce use the query: "pesce gatto" pesce or "pesce gatto" OR pesce

AND

The AND operator matches documents where both terms exist anywhere in the text of a single document. This is equivalent to an intersection using sets. The symbol && can be used in place of the word AND.
To search for documents that contain "uomo donna" and "donna giovani" use the query: "uomo donna" AND "donna giovani"

+

The "+" or required operator requires that the term after the "+" symbol exist somewhere in a the field of a single document.
To search for documents that must contain "luccio" and may contain "dentice" use the query:
+luccio dentice

NOT

The NOT operator excludes documents that contain the term after NOT. This is equivalent to a difference using sets. The symbol ! can be used in place of the word NOT.
To search for documents that contain "pesce gatto" but not "pesce cane" use the query:
"pesce gatto" NOT "pesce cane"

-

The "-" or prohibit operator excludes documents that contain the term after the "-" symbol.
To search for documents that contain "pesce gatto" but not "pesce cane" use the query:
"pesce gatto" -"pesce cane"
or
gatto -pesce

Escaping Special Characters

+ - && || ! ( ) { } [ ] ^ " ~ * ? : \
These characters have special features as described previously for some of them. In case you need to use one of them in a search query you must previously escape it.
For example, the following query will produce an error
sicuramente (e giustamente
so instead will be successful
sicuramente \(e giustamente