Word 2003中,2007年和2010使用的文件如何索引Lucene.NET [英] How to index Word 2003, 2007 and 2010 documents using Lucene.NET

查看:163
本文介绍了Word 2003中,2007年和2010使用的文件如何索引Lucene.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写一个自定义的Lucene.NET索引,以便对MS Word文档的索引。索引器必须能够处理最后三个版本的MS Word的:2010年,2007年和2003年

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.

该计划是利用已安装的Visual Studio 2010来提取文档中的文本内容的一部分VSTO互操作程序集。

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

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

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?

工具/环​​境:

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

注意:有关如何实现这一细节,请参见<一href="http://stackoverflow.com/questions/6584316/sitecore-text-search-in-pdf-or-word-documents/6586180#6586180">Sitecore以PDF或Word文档中的文本搜索

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

推荐答案

您可以使用IFilter的插件,让你找回文件的内容,然后对其进行索引。该接口是原Microsoft索引服务的一部分,但通常可用于索引文件。

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.

我在几年前看着的技术,似乎要记住,无论是用于Office文件被内置到Windows或者可以从完整的Office软件包单独安装的,但我可能是错在这里。

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.

更多关于IFilter的技术为的IFilter在Wikipedia 和的的IFilter在MSDN 。你将不得不考虑的P / Invoke,可能会得到一些启示的IFilter在pinvoke.net

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.

在C#中的样品可以在 MSDN code库中找到

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

这篇关于Word 2003中,2007年和2010使用的文件如何索引Lucene.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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