Indexing in Apache Solr of all files contained in a folder and its subfolders

荒凉一梦 提交于 2020-04-30 07:35:56

问题


Can Apache Solr be used to index all the files of a folder(Parent) and its subfolders, containing files of all types: XML, .json, .pdf,.doc etc..?


回答1:


Using post tool can be done

java -Dc=test -Drecursive -Dauto -jar post.jar folder

-Dauto for all file types that solr can handle

-Dc to specify collection name

-Drecursive to handle if folder has files inside subfolder.

if folder has has subfolder it will index files inside subfolder




回答2:


You need to use a Data Import Handler to achieve that . You can find information about how to implement it here http://wiki.apache.org/solr/DataImportHandler . Data import handler has an option recursive=true that allows you to index files nested in folders .Go through documentation in the link , and you will find a solution for yourself . Hope this helps :) .




回答3:


Latest Solr actually ships with an examples showing how to do that, including a custom interface to play with. The example is located in examples/files and you just need to follow the README.txt instructions.



来源:https://stackoverflow.com/questions/39249343/indexing-in-apache-solr-of-all-files-contained-in-a-folder-and-its-subfolders

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!