This document provides an introduction to the query language implemented by ftss. A complete grammar file for the language can be found here.
ftss processes queries similar to popular search engines. It supports phrase queries, OR, AND, NOT, and NEAR. Queries are performed in a case insensitive manner. The basic structure of a query is:
PHRASE <[CONJUNCTION] PHRASE>...
A phrase is one or more words enclosed within double quotes. If a phrase is one word only then the double quotes are optional. The following are all examples of phrases.
Conjuctions (OR, AND, NOT, and NEAR) have the same function as in other search engines. If no conjunction is given then OR is implied. The precedence from lowest to highest is:
You can use parenthesis to override precedence.
Here are some example queries and the results expected.
account - Returns documents that contain account.
account number - Returns documents that contain either account or number
account OR number - Same as above.
"account number" - Returns documents that contain the entire phrase "account number".
account NOT number - Returns documents that contain account but not number
account OR "social security" AND number - Returns documents that contain either account or both "social security" and number.
(account OR "social security") AND number - Returns documents that contain either account or "social security" and number. For instance, a document that contained "account social security" would not match, but a document that contained "account number" would match.