问题
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)"
回答1:
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.
来源:https://stackoverflow.com/questions/13746766/lucene-net-index-all-files-in-a-folder