我正在尝试使用具有最大距离的近邻术语编写全文搜索。
据我所知的语法...
<custom_proximity_term> ::=
NEAR (
{
{ <simple_term> | <prefix_term> } [ ,…n ]
|
( { <simple_term> | <prefix_term> } [ ,…n ] )
[, <maximum_distance> [, <match_order> ] ]
}
)
<maximum_distance> ::= { integer | MAX }
<match_order> ::= { TRUE | FALSE }
...我应该可以这样使用NEAR
:
'NEAR(term1,term2,5)'
或者
'NEAR((term1,term2),5)'
但是总是抛出语法错误。
Syntax error near '(' in the full-text search condition 'NEAR((term1, term2), 4, TRUE)'.
即使我尝试从微软示例复制确切的搜索,它也会引发错误:
USE AdventureWorks2012
GO
SELECT DocumentNode, Title, DocumentSummary
FROM Production.Document AS DocTable
INNER JOIN CONTAINSTABLE(Production.Document, Document,
'NEAR(bracket, reflector)' ) /* doesn't like this */ AS KEY_TBL
ON DocTable.DocumentNode = KEY_TBL.[KEY]
WHERE KEY_TBL.RANK > 50
ORDER BY KEY_TBL.RANK DESC
GO
Syntax error near '(' in the full-text search condition 'NEAR(bracket, reflector)'.