索引Solr时如何指定文件类型

How to specify file types when indexing Solr

我一直在索引 folders/files 的目录,其中包含 html 页面、文档、ppts、pdfs..等。我注意到一种名为 LOG 的文件正在被索引,我不希望它被索引,因为不需要它的内容。

为了索引到 Solr 我一直在使用这个命令(我是 windows 用户所以我使用简单的 post 工具):java -Dc=collection -Dport=4983 -Drecursive -Dauto jar example/exampledocs/post.jar c:/folder 相反,我尝试做以下命令排除 LOG 文件:

java -Dc=collection -Dport=4983 -Drecursive -Dfiletypes=xml,json,csv,pdf,doc,docx,ppt,pptx,xls,xlsx,odt,odp,ods,ott,otp,ots,rtf,htm,html,txt jar example/exampledocs/post.jar c:/folder

Solr 拒绝索引,并抛出错误 (#400 http)。 -Dfiletypes 应该是我可以使用的实际命令,但 Solr 似乎不喜欢它。我什至在文件类型列表周围尝试了 [],但它不起作用。我的语法有误吗?

如果我添加 -Dauto,就可以了!

java -Dc=collection -Dport=4983 -Drecursive -Dauto -Dfiletypes=xml,json,csv,pdf,doc,docx,ppt,pptx,xls,xlsx,odt,odp,ods,ott,otp,ots,rtf,htm,html,txt jar example/exampledocs/post.jar c:/folder