简体   繁体   English

如何使用Solr将文件发送到HDFS

[英]How to send files to HDFS using Solr

I am trying to index files and keep these files on HDFS. 我正在尝试索引文件并将这些文件保留在HDFS上。

I am using Solr 4.10.4 and Hadoop 2.6.0. 我正在使用Solr 4.10.4和Hadoop 2.6.0。

The command I use for integration HDFS and Solr is; 我用于集成HDFS和Solr的命令是;

java -Dsolr.directoryFactory=HdfsDirectoryFactory -Dsolr.lock.type=hdfs -Dsolr.data.dir=hdfs://<hostname>:<port>/Solr -Dsolr.updatelog=hdfs://<hostname>:<port>/Solr-logs -jar start.jar

When I try to send some files using 当我尝试使用发送一些文件

java -jar post.jar <file-path>

command, Solr gives warning and does not send it to hdfs. 命令,Solr发出警告,并且不将其发送到hdfs。 It only accepts xml format with specific fields. 它仅接受具有特定字段的xml格式。

How can I send any kind of file using Solr for indexing to HDFS and do search on these files using Solr. 如何使用Solr发送任何类型的文件以索引到HDFS,并如何使用Solr在这些文件上进行搜索。

Note: I am beginner on Solr and Hadoop. 注意:我是Solr和Hadoop的初学者。

if want to index other file format you can specify document type as like below 如果要索引其他文件格式,可以指定文档类型,如下所示

java -Dtype=text/csv -jar post.jar *.csv

By default below command takes care of all possible file types that Apache Tika can handle 默认情况下,以下命令会处理Apache Tika可以处理的所有可能的文件类型

java -Dauto -jar post.jar *.*

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM