Using wildcard operators

Wildcards let you specify some leeway when searching for text. You use them to replace one or more letters of words so that multiple matches can be found.

The three wildcards:

* (an asterisk) - use this to match any number of consecutive

characters. For example, if you search for br*n, the search will find

brown and broken, but not bangle.

? (a question mark) - use this to match any single character. For

example, if you search for 102?, the search will find 102A and 1025,

but not 1025A.

[ ] (square brackets) - use these to match any specified

characters. For example, if you search for bro[oa]ch, the search will

find both broach and brooch.

You can combine wildcards to provide even more powerful searches. For example, if you search for J[oa]n*, the search will find records which

contain, amongst others, Jona, Jane, Jong, Jang, etc.

Using Boolean operators

Also known as logical operators, Boolean operators can also be used to combine many terms in search text.

The three Boolean operators:

and - use this to match only if both pieces of text are found. For

example, if you search for fish and angler, only those records are

found where both those words appear in any order in the text.

or - use this to match if either piece of text, or both, are found in the appropriate record. For example, if you search for fishing or shooting or cycling, all records in which at least one of those terms is present will be found.

not - use this to match if the text does not appear in the record. For example, if you search for not back, the search will find all records in which back does not appear.

You can combine Boolean operators to provide more powerful searches. For example, if you search for:

pain and not back

Proximity

The proximity operators # and ## make it possible to search for adjacent terms:

black # blue

black ## blue

The first example will find records where the term 'black' occurs immediately before the term 'blue', with only a space character separating them. The second example does the same except that the order of the terms may be reversed (i.e. it will find 'black blue' and 'blue black').

A maximum distance between terms may be specified using a numeric suffix. For example:

black ##4 blue

will find records where 'black' occurs within four words of 'blue'.

In a case like October # 1984, the number will be interperated as the maximum distance between terms rather than a term unless it is

parenthesised or single or double quoted. Another way round the ambiguity is to search for 1984 ## October!

Understanding precedence

The search has rules for working out the order in which it should evaluate expressions that use more than one operator. These rules define what is known as precedence.

For example, without precedence there are two ways to interpret the search text:

chair and wood or iron

find all records that have both the words 'wood' and 'chair' in

them, or have the word 'iron'

find all records that have the word 'chair', and also one or both of

the words 'wood' or 'iron'.

You can see that these searches would find a very different set of records. Therefore, if the search can find no brackets to show how to perform the evaluation (see below), it resorts to its rules of precedence. These rules tell it which operators to combine in which order. The order it uses is as follows:

brackets

proximity operators (containing double quotes or the # character)

Boolean not operator

Boolean and operator

Boolean or operator Using brackets to override precedence

You can override the the precedence rules by using brackets to group together terms you want to find, just as you would in mathematics.

For example, if you entered:

chair and wood or iron

as your search text, the precedence rules would evaluate the two terms separated by and first of all (because it has higher precedence), and then the or operator with the final word. The resulting matches would be interpreted as:

find all records that have both the words 'wood' and 'chair' in them, or have the word 'iron'.

To change this search, you would use brackets to join together the materials:

chair and (iron or wood)

The brackets would be evaluated first (because brackets have higher precedence than anything else) and then logically combined with chairs. Now the resulting matches would be interpreted as:

find all records that have the word 'chair', and also one or both of the words 'wood' or 'iron'.