A possible solution is to use a directory on the server to upload the
files. Monitor the directory for new uploads and then post the documents
to the solr using curl.
If you are using a linux based server you can use inotifywatch to
monitor the folder for new file uploads and then use the following curl
command
curl
"http://<solrhost>:<solrport>/solr/update/extract?literal.id=<documentname.ext>&uprefix=attr_&fmap.content=content&literal.type=binaryfile&literal.url=<http://yourdomain/uploads_directory/documentname.ext>"
-F "myfile=@<full_path_on_server_of_the_upload_directory/documentname.ext>"
curl http://<solrhost>:<solrport>/solr/update --data-binary '<commit/>'
-H 'Content-type:text/xml; charset=utf-8'
Replace the following with actual values :
<solrhost>:<solrport>
<documentname.ext> : Actual name with extension
<http://yourdomain/uploads_directory/documentname.ext>
<full_path_on_server_of_the_upload_directory/documentname.ext>
---
Regards,
Kaustuv Royburman
Senior Software Developer
infoservices.in
DLF IT Park,
Rajarhat, 1st Floor, Tower - 3
Major Arterial Road,
Kolkata - 700156,
India
On Thursday 18 November 2010 12:10 PM, Lance Norskog wrote:
Upload the files independently of Solr. Solr is not a content
management system.
One problem is getting the links put together so that the link that
comes out with the document can be turned into a link the user can open.
Chad Salamon wrote:
I would like to save files sent to the ExtractingRequestHandler on the
server processing it, and provide a link to the file in the solr
document. I currently am running a solr core as a part of a larger web
app, and I would like to publish the files as a part of that same web
app. This way, both solr and the files can be behind the same security
filters (Spring Security).
I can think of two ways to do this - one would be to extend
ExtractingRequestHandler to grab the files and then save them where I
want to. The other would be to upload the files independently of Solr
and then send them to the ExtractingRequestHandler through remote
streaming.
Any other suggestions would be appreciated. Thanks.