1
votes

I have a file which needs to be indexed on our solr server. How can I upload a file? I know how to do it with curl: curl "http://localhost:8983/solr/update/extract?literal.id=doc1&uprefix=attr_&fmap.content=attr_content&commit=true" -F "[email protected]"

(from http://wiki.apache.org/solr/ExtractingRequestHandler ) but I don't know how to translate that to the rsolr rubygem.

Thanks in advance.

1

1 Answers

1
votes

This is how you can upload a file:

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'
    }