![]() |
|
|
|
UniGrid Search supports powerful searches using a variety of expressions. We will give you an overview of their syntax in this topic. We are basing it on the documentation written by Tamarack Associates for their Rubicon component which Alventis uses for its full-text indexing needs.
Searches support the following operators (listed in the highest to lowest order of precedence): LIKE, NEAR NOT AND, OR Note that we are writing the operators in uppercase simply to make them stand-out from surrounding text, if any. The entire search text is case-insensitive, which applies to both literal text you are searching for and operators, so in "real life", a search for "Jack AND Smith" is equivalent to "jack and smith".
The following expressions show the syntax of each operator: LIKE <string> <string> NEAR <string> NOT <expression> <expression> OR <expression> <expression> AND <expression> In the above: <string> is a literal string of text you are looking for, possibly ending with a wildcard character (e.g., maple, map*) <expression> can be a <string> or another, simpler, expression, possibly enclosed in parentheses
This should become clear from some examples:
As you may have gathered, you can use two wildcard characters: * means "any sequence of characters" (or none) ? means "any single character" You can freely mix-and-match them as you wish, e.g., *uto??b* would match "automobile" or "utofobia" (if such a thing existed).
You can enclose phrases or words you want to find in a particular sequence in double or single quotes: "good dog" is equivalent to 'good dog'. Whichever quotes you use, you must always make sure you match them properly, i.e., that you have proper pairs of quotes of the same kind. Same goes for parenthesis.
There's also one simplified type of search you can perform. If you don't need to use any expression operators, you can simply make a search consisting of a space-separated list of words, and the search will use the AND logic for them. For example, the following two searches are equivalent: maple syrup pine maple AND syrup AND pine
If you write a search that Alventis cannot understand according to the syntax described above, the search won't be executed, and Alventis will make the search text red as an indication of an error condition. This may happen periodically while you are in the process of typing your search. For instance, if the search you intend to execute is "maple AND syrup" (with no quotes), the moment you type "maple AND", the search expression becomes red indicating an error. This makes sense since the above expression is indeed syntactically incorrect. But since you know you'll "fix" it in a moment by adding "syrup" to it, you should simply ignore such transient errors.
There are two search types that are more time-consuming than the rest: searches where the expression starts with a wildcard (e.g., "*ortoise") and proximity searches (e.g., "slow NEAR search"). They may take on the order of 1 second per 1000 records, so it only becomes a problem for large tables. |