是否可以在全文搜索中结合NEAR和FORMSOF? [英] Is it possible to combine NEAR and FORMSOF together in a fulltext search?
问题描述
SELECT * FROM AwesomePeople WHERE CONTAINS(Name,'NEAR((Nathan,Fillion), MAX,TRUE)')
但我想结合它,所以它使用我的同义词词典来查看 Nathan
和 Fillion
。
我可以这样做:
$ b $
SELECT * FROM AwesomePeople WHERE CONTAINS(Name,'FORMSOF(THESAURUS,Nathan))
但我不知道如何搜索2个单词,或者在单个查询中将它们做成FORMSOF和NEAR。我已经尝试了几种组合,但运气不好。
有什么想法?
来自technet:
http://technet.microsoft.com/en-us/library/ms142568%28v=sql.110%29.aspx
不能将自定义近似术语与通用临近点
术语(术语1近似术语2),生成术语(ISABOUT ...)或加权
术语(FORMSOF ...)组合。
也降低了
$ b
您不能合并通用近似术语与自定义近似
术语,例如NEAR((term1,term2),5),加权术语(ISABOUT ...)或
世代术语(FORMSOF ...)。
Technet似乎将ISABOUT和FORMSOF混合在第一个报价单中,但无论是哪种方式,ISABOUT或FORMSOF条款都不能与NEAR期限结合使用。
I have this:
SELECT * FROM AwesomePeople WHERE CONTAINS(Name, 'NEAR(("Nathan", "Fillion"), MAX, TRUE)')
But I want to combine it so it uses my thesaurus of words to look at alternatives for
Nathan
andFillion
.I can do this:
SELECT * FROM AwesomePeople WHERE CONTAINS(Name, 'FORMSOF (THESAURUS, "Nathan"))
But I don't know how to search for 2 words, or make it do FORMSOF and NEAR together in a single query. I have tried a few combinations but am out of luck.
Any ideas?
解决方案It looks like you are using SQL Server 2012 as 'NEAR(("Nathan", "Fillion") is the newer form of proximity search, called custom proximity search.
From technet: http://technet.microsoft.com/en-us/library/ms142568%28v=sql.110%29.aspx
You cannot combine a custom proximity term with a generic proximity term (term1 NEAR term2), a generation term (ISABOUT …), or a weighted term (FORMSOF …).
and also lower down
You cannot combine a generic proximity term with a custom proximity term, such as NEAR((term1,term2),5), a weighted term (ISABOUT …), or a generational term (FORMSOF …).
Technet seems to have the ISABOUT and FORMSOF mixed up in the first quote, but either way ISABOUT or FORMSOF terms cannot be combined with a NEAR term.
这篇关于是否可以在全文搜索中结合NEAR和FORMSOF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!