我有一个文件需要在我们的solr服务器上建立索引。如何上传文件?我知道如何使用curl: curl "http://localhost:8983/solr/update/extract?literal.id=doc1&uprefix=attr_&fmap.content=attr_content&commit=true“-F "myfile=@tutorial.html”
(来自http://wiki.apache.org/solr/ExtractingRequestHandler ),但我不知道如何将其转换为rsolr rubygem。
提前谢谢。
发布于 2011-11-08 17:08:12
以下是上传文件的方法:
solr = RSolr.connect :url => 'http://your.solrserver.com:8983/solr'
solr.post 'update/extract', :params => {
:'literal.id' => 'your-id',
:'fmap.content' => 'attr_content',
:'stream.file' => '/path/to/your/file/,
:uprefix => 'attr_f',
:commit => 'true'
}https://stackoverflow.com/questions/8037665
复制相似问题