从存储在varbinary(max)列中的.doc类型中查找结果
我想在存储有.doc/.docx(MS-Word)文件的varbinary(max)类型的列上编写带有全文本搜索的查询. 我的查询必须返回在存储文件中包含单词的记录.
i want to write a query with Full-Text-Search on a column with varbinary(max) type that stored a .doc/.docx(MS-Word) file. my query must returns records that contain a word in stored file.
这可能吗?
如果是,怎么办?(请写个例子)
if yes,how?(please write an example)
如果可以,我们可以用其他语言(例如阿拉伯语,波斯语或UniCode字符)来写吗?
if yes,can we write that for other language(e.g Arabic,Persian or a UniCode characters)?
先谢谢你
您正在寻找的是全文本索引,这在SQL Server 2008中已得到很大改进.
What you're looking for is fulltext indexing, which has been greatly improved in SQL Server 2008.
有关介绍,我建议您在此处查看以下文章:
For an introduction, I would recommend checking out these articles here:
- SQL Server 2008 - Creating Full Text Catalog and Search
- Understanding Full-Text Indexing in SQL Server
- Fulltext-Indexing Workbench
一旦您了解了这一点并创建了自己的全文目录,就应该可以搜索如下内容:
Once you understand this and have created your own fulltext catalog, you should be able to search something like this:
SELECT ID, (other fields), DocumentColumn
FROM dbo.YourTable
WHERE CONTAINS(*, 'Microsoft Word')
是的,全文索引和搜索确实支持多种语言-请查看我发送给您的链接和SQL Server 2008联机丛书以获取详细信息!
And yes, Fulltext indexing and searching does support lots of languages - check out the links I've sent you and the SQL Server 2008 Books Online for details!
马克