View Source

The basic unit of a query is a _term_. In its simplest form, a term is simply a _word_ or a _number_. A term may also include embedded punctuation such as hyphens or slashes, and may in fact be more than one word separated by such embedded punctuation. A term may also include _[wildcard|lweug20:Wildcard Queries]_ ('?' and '*').

This basic form of term is referred to as a _single term_. For example, the following are all single terms:
* {{cat}}
* {{CD-ROM}}
* {{123}}
* {{1,000}}
* {{\-456}}
* {{\+7.89}}
* {{$1,000.00}}
* {{cat\*}}
* {{?at}}
* {{at?c*he}}

Numbers optionally may have a leading + or {{\-}} sign that is considered part of the number. If you wish to place the 'must' or 'must not' operators in front of an unsigned number, add an extra '+' between the operator and the unsigned number.

There is a second form of term called a _[phrase|lweug20:Phrase Query]_, which is a sequence of terms enclosed in double quotation marks. The intention is that the terms (words) are expected to occur in that order and without intervening terms. An alternative purpose is simply to indicate that a Lucid keyword operator should be interpreted as a natural language word rather than as an operator. For example:

* {{"In the beginning" "George Washington" "AND" "myocardial infarction"}}

A third form of term is the _[range query|lweug20:Range Queries]_, which is a pair or terms which will match all terms that lexically fall between those two terms. For example, {{\[cat TO dog\]}} matches all terms between cat and dog in lexical order (i.e., alphabetically, in this case).

A fourth form of term is a parenthesized sub-query which may be a complex Boolean query. For example:

* {{cat (bat OR fish AND giraffe) zebra}}

A sequence of terms (of any form -- single, phrase, range, or sub-query) is referred to as a _term list_. A term list might be used to represent one or more compound terms, or simply a list of keywords and phrases, or a combination of the two. A term list is the most common form of query. In this basic form, a term list has no operators.

Note that for non-text fields, a term may not actually be a word or number, but may have a special syntax specific to that field such as a part number or telephone number.

In order to offer advanced search functions, each term can optionally be preceded or followed by various _[term modifiers|Term Modifiers]_. An example of a modifier before a term is a _[field name|lweug20:Field Queries]_. An example of a modifier after a term is a _boost factor_.

A subset of operators (_[term operators|Term Operators]_, + and {{\-}}) may also be included within a term list.

{scrollbar}