Home Home

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

搜索帮助

中文搜索帮助            使用逻辑操作符,会使您的搜索变得准确。这些逻辑操作符包括:或,与,非。您也可用( )对搜索词加以组织,或提供搜索词的优先次序。但使用逻辑操作符时, 逻辑操作符须用空格与搜索词或其它逻辑操作符分隔开,否则逻辑操作符会被视为搜索词的一部分。逻辑操作符 是可以省略的。比如说, 注:此搜索技术与谷歌的搜索类似。自家制作了一个编译器。该编译器对用户的搜索输入进行扫描,并解析成一个表达树,再将其翻译成SQL SELECT 语句的 WHERE 条款, 然后对含有字词的表栏进行全文本检索。但是,由于Microsoft contains() 函数的限制,逻辑操作符 不能用于逻辑操作符 之后,也不能用于一个独立的搜索词之前, 只能用于逻辑操作符 之后 (注: 记得逻辑操作符 是可省略的)。
所以如下之搜索行不通: 1) 外衣 或 非 裤子
                                             2) 裤子 (作为一个独立的搜索词)
但如下之搜索行得通: 1) 外衣 与 非 裤子
                                         2) 外衣 裤子

自家生产的编译器实现如下语法: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
注: 使用逻辑操作符时, 逻辑操作符须用空格与搜索词或其它逻辑操作符分隔开,否则逻辑操作符会被视为搜索词的一部分。


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