如何使用 Lucene.NET 索引 Word 2003、2007 和 2010 文档

发布于 2024-09-29 02:52:11 字数 529 浏览 2 评论 0原文

我正在编写一个自定义 Lucene.NET 索引器来启用 MS Word 文档的索引。索引器必须能够处理 MS Word 的最后三个版本:2010、2007 和 2003。

计划使用作为 VS2010 一部分安装的 VSTO 互操作程序集从文档中提取文本内容。

有没有更好的方法来实现Word文档索引? 这是否意味着我必须在服务器上安装所有三个版本的 Word?或者只是 Word 2010?

工具/环境:

  • Lucene.NET 2.3.1.3
  • VS2010 / .NET 3.5
  • Windows 2008 / IIS 7

注意:有关如何实现的详细信息,请参阅PDF 或 Word 文档中的 Sitecore 文本搜索

I am writing a custom Lucene.NET indexer to enable indexing of MS Word documents. The indexer must be capable of handling last three releases of MS Word: 2010, 2007 and 2003.

The plan is to use VSTO interop assemblies that are installed as part of VS2010 to extract text content from the documents.

Is there a better way to implement Word document indexing?
Does this mean I will have to install all three versions of Word on the server? Or just Word 2010?

Tools/Environment:

  • Lucene.NET 2.3.1.3
  • VS2010 / .NET 3.5
  • Windows 2008 / IIS 7

Note: For details on how to implement this, see Sitecore text search in PDF or Word documents

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不乱于心 2024-10-06 02:52:11

您可以使用 IFilter 插件来检索文档的内容,然后为它们建立索引。该接口最初是 Microsoft Index Service 的一部分,但通常可用于索引文档。

几年前,我研究了这项技术,似乎记得 Office 文档的过滤器要么内置于 Windows 中,要么可以与完整的 Office 软件包分开安装,但我在这里可能是错的。

有关 IFilter 技术的更多信息,请访问 Wikipedia 上的 IFilterMSDN 上的 IFilter。您必须研究一下 P/Invoke,并可能会得到一些灵感 pinvoke.net 上的 IFilter

C# 示例可以在 MSDN 代码库 中找到。

You could you use the IFilter plugins to let you retrieve the contents of the documents and then index them. The interface is originally part of Microsoft Index Service but is generally available for indexing documents.

I looked into the technology a couple of years ago and seem to remember that either the filters for Office documents were built into Windows or could be installed separately from the complete Office package but I may be wrong here.

More about the IFilter technology at IFilter at Wikipedia and IFilter at MSDN. You will have to look into P/Invoke and might get some inspiration IFilter at pinvoke.net.

A sample in C# can be found at MSDN Code Gallery.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文