Lucene.Net索引文件夹中的所有文件 [英] Lucene.Net Index all files in a folder
问题描述
是否可以为特定文件夹中的所有文件建立索引? 引用一个文件夹,然后以某种方式将文件夹中的所有文档添加到索引中,而不必遍历文件夹中的所有文件.在DtSearch中,有一种方法可用于"IndexFilesInFolder(foldername)"
Is there a way to index all files in a specific folder? Refer to a folder, and somehow add all the documents in the folder to the index without having to loop through all the files in the folder. In DtSearch, there was a method to "IndexFilesInFolder(foldername)"
推荐答案
有一个,其中包括示例如何为文件夹中的所有文件建立索引以及如何搜索索引的示例.它适用于基本的文本文档,您需要处理其他文档类型以提取其内容.
There's a demo directory in the Lucene.Net source which includes examples how to index all files in a folder, and searches the index. It works for basic text documents, you'll need to handle other document types to extract their content.
这篇关于Lucene.Net索引文件夹中的所有文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!