MSSQL 2008 全文搜索:词干提取是否考虑语法性别?
我们使用 SQL Server 2008 的全文搜索来让客户使用 FREETEXTTABLE()
查询检索记录。
给出如下搜索:
SELECT * FROM FREETEXTTABLE(SomeTable, SomeValueColumn, 'Kunde')
Or:
SELECT * FROM FREETEXTTABLE(SomeTable, SomeValueColumn, 'Leser')
(分别表示“客户”和“读者”的德语单词。)
,我也希望得到这些单词的女性形式的结果。但是,只有当我明确搜索“Kundin”或“Leserin”时,这些结果才会出现。
服务器的默认全文语言是1031
(即德语)。语言组件是 NaturalLanguage6.dll
,版本 6.0.6001.18000
。
<一href="http://books.google.com/books?id=wGwVkAt79bEC&pg=PA106&lpg=PA106&dq=sql+stemming+gender&source=bl&ots=fveH95fo8e&sig=0DAjtJPQfVci6hAJfdglCGo7 EwQ&hl=en&ei=-hraTdfMCIuVswb07Oj3Ag&sa=X&oi=book_result&ct=结果&resnum=2&ved=0CCMQ6AEwAQ#v=onepage&q=sql%20stemming%20gender&f=false" rel="nofollow">根据一本书,这应该有效:
SQL Server iFTS 自动包含适应其他语言性别规则的词干逻辑 [..]
这应该有效吗?如果没有,我可以通过 A) 安装附加/不同的语言组件,或 B) 使用不同的全文引擎(例如 Lucene.NET)来使其工作吗?
We're using SQL Server 2008's full-text search to let customers retrieve records using FREETEXTTABLE()
queries.
Given a search like:
SELECT * FROM FREETEXTTABLE(SomeTable, SomeValueColumn, 'Kunde')
Or:
SELECT * FROM FREETEXTTABLE(SomeTable, SomeValueColumn, 'Leser')
(German words for 'customer' and 'reader', respectively.)
, I would expect results for the feminine forms of those words as well. However, those results only appear if I explicitly search for 'Kundin' or 'Leserin'.
The server's default full-text language is 1031
(i.e., German). The language component is NaturalLanguage6.dll
, version 6.0.6001.18000
.
According to a book, this should work:
SQL Server iFTS automatically includes stemming logic that accommodates gender rules for other languages [..]
Is this supposed to work? If not, can I make it work by A) installing an additional / different language component, or B) using a different full-text engine (e.g., Lucene.NET)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我猜测这种差异是由于上面的第一个链接是在 SQL 2008 发布之前编写的。第二个链接是一本专门为 SQL 2008 编写的书。
重新阅读 SQL 2008 FTS 中的完整章节书,因为您必须采取几个步骤才能使其发挥作用。即,识别查询中的语言。
请注意本书第 116 页的代码块(以德语为例):
这是 BOOKS ONLINE 链接(注意语言参数):
http://msdn.microsoft.com/en-us/library/ms176078.aspx
I'm guessing that the discrepency is due to the fact that your first link above was written prior to the release of SQL 2008. The second link is a book written explicitly for SQL 2008.
Re-read the complete chapter in the SQL 2008 FTS book, as there are several steps you have to take in order to get it to work. Namely, identifying the language in your query.
Note this code block from page 116 of the book (which is using German as an example):
Here is the BOOKS ONLINE link (note Langugage argument):
http://msdn.microsoft.com/en-us/library/ms176078.aspx