Home Home

Word Roots are a Part of History. "Histories Make Men Wise" -- Bacon.

Search Help

English Search Help:
           For more accurate search, you can use logical operators such as and, or, not in your search, and use parenthesises ( ) to group your search words or search terms, or to have priority. The logical operator and is optional and can be omitted. For example: Note: The search technique is similar to Google's search. User's search input is scanned and parsed by a homegrown compiler into an expression tree, and then translated into a WHERE clause of a Transact-SQL SELECT statement to perform SQL Server full-text search on full-text indexed columns containing character-based data type. However due to the limitation of the contains() function from Microsoft, logical operator not can not be used after or, neither can it be used before a standalone search term, it can only be used after logical operator and (which can be omitted).
So the following will not work: 1) jacket or not pants
                                                   2) not pants (as a standalone search term)
But the following works: 1) jacket and not pants
                                         2) jacket not pants

The following Grammar is implemented by the homegrown compiler:

PrimaryExpression ::= TermExpr | PhraseExpr | ParenthesizedExpression
AndExpression ::= PrimaryExpression | AndExpression AndOperator PrimaryExpression //leftRecursive: need to be converted to PrimaryExpr {AndOperator PrimaryExpr}*
OrExpression ::= AndExpression | OrExpression OrOperator AndExpression //leftRecursive: need to be converted to AndExpr {OrOperator AndExpr}*
ParenthesizedExpression ::= (OrExpression)
TermExpr ::= TermToken
PhraseExpr :: = PhraseToken
AndOperator ::= emptyString (or blank space) between TermTokens, PhraseToken, and ParenthesizedExpression | AND | AND NOT | NOT | 与 | AND 非 | 与 NOT | 与 非 | 非
OrOperator ::= OR | 或
Note: AND, OR, NOT, (与, 或, 非) must be separated with blank space from a search term, otherwise they will be considered as a part of the search term