'('在全文搜索条件'NEAR((方法,系统),3''附近的语法错误 [英] Syntax error near '(' in the full-text search condition 'NEAR((method,system),3'

查看:106
本文介绍了'('在全文搜索条件'NEAR((方法,系统),3''附近的语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的查询如下



select * from Test where contains(Description,''NEAR((method,system),3'')



它在sql server 2008中显示错误

你可以帮我任何一个吗?

解决方案

< blockquote>检查 CONTAINS语法附近[ ^ ]:

Quote:

< proximity_term>

指定必须在文档中的单词或短语的匹配项正在被搜索。与AND运算符一样,< proximity_term>要求搜索条件中存在搜索条件。

NEAR |〜

表示单词NEAR或〜运算符两侧的短语或短语必须出现在文档中以便返回匹配。几个邻近条款可以是cha如在NEAR b NEAR c或a~b~c中那样。链接的邻近条款必须全部在文档中才能返回匹配。

在CONTAINSTABLE函数中使用时,搜索项的邻近度会影响每个文档的排名。匹配的搜索项越接近文档,文档的排名越高。如果匹配的搜索字词相隔> 50个术语,则文档返回的等级为0.

例如, CONTAINS(column_name,''fox NEAR chicken'')和CONTAINSTABLE(table_name,column_name,''fox~chicken'')都将返回指定列中包含fox和chicken的所有文档。此外,CONTAINSTABLE基于狐狸和鸡的接近度返回每个文档的等级。例如,如果一个文档包含句子狐狸吃鸡,它的排名会很高......

  SELECT 说明
FROM Production.ProductDescription
WHERE < span class =code-keyword> CONTAINS (说明,' bike NEAR performance' );




My query as below

select * from Test where contains (Description,''NEAR((method,system),3'')

It shows error in sql server 2008
can you please help me any one?

解决方案

Check near CONTAINS syntax[^]:

Quote:

<proximity_term>
Specifies a match of words or phrases that must be in the document that is being searched. Like the AND operator, <proximity_term> requires both the search terms to exist in the document being searched.
NEAR | ~
Indicates that the word or phrase on each side of the NEAR or ~ operator must occur in a document for a match to be returned. Several proximity terms can be chained, as in a NEAR b NEAR c or a ~ b ~ c. Chained proximity terms must all be in the document for a match to be returned.
When used in the CONTAINSTABLE function, the proximity of the search terms affects the ranking of each document. The nearer the matched search terms are in a document, the higher the ranking of the document. If matched search terms are >50 terms apart, the rank returned on the document is 0.
For example, CONTAINS (column_name, ''fox NEAR chicken'') and CONTAINSTABLE (table_name, column_name, ''fox ~ chicken'') would both return any documents in the specified column that contain both "fox" and "chicken". In addition, CONTAINSTABLE returns a rank for each document based on the proximity of "fox" and "chicken". For example, if a document contains the sentence, "The fox ate the chicken," its ranking would be high...

SELECT Description
FROM Production.ProductDescription
WHERE CONTAINS(Description, 'bike NEAR performance');



这篇关于'('在全文搜索条件'NEAR((方法,系统),3''附近的语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆