The LIFTI Query Language
When you have constructed a FullTextIndexer
instance and set its QueryParser property to a
, you will be able to search the full text index using the LIFTI query language. This will allow you to write queries using the following operators:
||West must appear in the text.
||Words that starts with doc must appear in the text.
|west & wing
||The words west and wing must appear in the text
||The words west and wing must appear in the text - the default operator is & if none is specified between search words
|west | wing
||The words west or wing must appear in the text
|west ~ wing
||west and wing must appear near to each other (within 5 words) in the text
|west ~> wing
||west must be closely followed by wing (within 5 words) in the text
|west >> wing
||west must precede wing anywhere in the text
|"the west wing"
||The words the west wing must appear in sequence in the indexed text.
||A word starting with notr must be immediately followed by a word starting with dam.
If you specify two search words in a query without a joining operator, then they will automatically be combined with an and (&) operator, so the queries
west & wing
is equivalent to west wing
. (Just to clarify, searching for
is different - this indicates that the words should appear in sequence - the previous searches only enforce that the words appear
in the text.)
Query operators can be combined, so you can write a query such as the & west & wing
to search for items that have all 3 words indexed against them.
Naturally you can mix and match operators, so "west wing" & "oval office"
would search for items with the phrases "west wing" and "oval office" indexed against them.
When combining operators you need to be aware of operator precedence. Operators will be processed in the following order:
- Positional operators (~, ~> and >>)
- And (&)
- Or (|)
This means that west & wing | oval office
would search for items containing both
, or items containing oval
You can specify your own precedence by using brackets
This means that you could write west & (wing | oval) & office
to search for items containing
and either wing