post the output of a URL to solr

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

post the output of a URL to solr

Bess Sadler
I think there must be a way to do this because I think I've seen  
references to it, but I cannot find the proper syntax anywhere. Can I  
post the output of a URL to solr? That is to say, if I have a webapp  
that is generating the solr indexable files (e.g., http://localhost: 
8888/gaz/solr/f0.xml will give an xml file of the type that solr  
expects) do I need to download the file to disk and then post it, or  
can I post it directly?

It seems like I should be able to do this:

sh post.sh http://localhost:8888/gaz/solr/f0.xml

But this doesn't work. Instead, I keep having to do this:

wget http://localhost:8888/gaz/solr/f0.xml
sh post.sh ./f0.xml

I'm happy to re-write the curl command used by post.sh, but I can't  
figure out what the syntax would be. Anyone out there posting data in  
this way?

Thanks in advance,
Bess Sadler


Elizabeth (Bess) Sadler
Head, Technical and Metadata Services
Digital Scholarship Services
Box 400129
Alderman Library
University of Virginia
Charlottesville, VA 22904

[hidden email]
(434) 243-2305


Reply | Threaded
Open this post in threaded view
|

Re: post the output of a URL to solr

Mike Klaas
On 11/30/06, Bess Sadler <[hidden email]> wrote:
> I think there must be a way to do this because I think I've seen
> references to it, but I cannot find the proper syntax anywhere. Can I
> post the output of a URL to solr? That is to say, if I have a webapp
> that is generating the solr indexable files (e.g., http://localhost:
> 8888/gaz/solr/f0.xml will give an xml file of the type that solr
> expects) do I need to download the file to disk and then post it, or
> can I post it directly?

Try something like:

wget http://localhost:8888/gaz/solr/f0.xml -O - | curl
http://localhost:8983/solr/update --data-binary - -H
'Content-type:text/xml; charset=utf-8'

-Mike
Reply | Threaded
Open this post in threaded view
|

Re: post the output of a URL to solr

Bertrand Delacretaz
On 11/30/06, Mike Klaas <[hidden email]> wrote:

> ...Try something like:
>
> wget http://localhost:8888/gaz/solr/f0.xml -O - | curl
> http://localhost:8983/solr/update --data-binary - -H
> 'Content-type:text/xml; charset=utf-8'

and if you use curl you can use it on both sides to avoid the
dependency on both tools:

  curl http://localhost:8888/gaz/solr/f0.xml | curl ...

-Bertrand