You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by "Binkley, Peter" <Pe...@ualberta.ca> on 2007/01/31 19:56:06 UTC

Posting from Ant

Is there an Ant task out there somewhere that can POST bunches of files
to Solr, doing what the post.sh script does but with filesets? 

I've found the http post task
(http://antelope.tigris.org/nonav/docs/manual/bk03ch17.html), but it
just posts name-value pairs, not files; and Slide's set of webdav client
tasks
(http://gulus.usherbrooke.ca/pub/appl/apache/jakarta/slide/binaries/jaka
rta-slide-ant-webdav-bin-2.1.zip) has PUT and GET but not POST. It
shouldn't be hard to adapt one of these, but something pre-existing
would be better.

Peter

Peter Binkley
Digital Initiatives Technology Librarian
Information Technology Services
4-30 Cameron Library
University of Alberta Libraries
Edmonton, Alberta
Canada T6G 2J8
Phone: (780) 492-3743
Fax: (780) 492-9243
e-mail: peter.binkley@ualberta.ca


Re: Posting from Ant

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
Good eye, Hoss!

I meant to mention the <foreach> task, but my Ant committership would  
have been revoked :)  (just kidding, but it is controversial and this  
is why it doesn't exist in Ant itself).

And you can, of course, always <exec> to curl or to Solr's example  
post.sh.

	Erik


On Feb 1, 2007, at 12:38 AM, Chris Hostetter wrote:

>
> : I wondered about that file attribute too, but I think it's  
> supposed to
> : call up a java properties file to set name-value pairs. And  
> anyway it's
>
> the site you're looking at seems to have an older version of the
> ant-contrib modules ... if you look at the primary documentation it
> mentions a "rawFile" option to do exactly what you want...
>
> http://ant-contrib.sourceforge.net/tasks/tasks/post_task.html
>
> : only a single file rather than a fileset.
>
> take a look at the foreach task from the same package...
>
> http://ant-contrib.sourceforge.net/tasks/tasks/foreach.html
>
>
>
>
> -Hoss


RE: Posting from Ant

Posted by Chris Hostetter <ho...@fucit.org>.
: I wondered about that file attribute too, but I think it's supposed to
: call up a java properties file to set name-value pairs. And anyway it's

the site you're looking at seems to have an older version of the
ant-contrib modules ... if you look at the primary documentation it
mentions a "rawFile" option to do exactly what you want...

http://ant-contrib.sourceforge.net/tasks/tasks/post_task.html

: only a single file rather than a fileset.

take a look at the foreach task from the same package...

http://ant-contrib.sourceforge.net/tasks/tasks/foreach.html




-Hoss


RE: Posting from Ant

Posted by "Binkley, Peter" <Pe...@ualberta.ca>.
Erik wrote:
 
 The 'file' 
attribute might be able to do the trick, though I'm not quite sure 
from the description.


 
I wondered about that file attribute too, but I think it's supposed to call up a java properties file to set name-value pairs. And anyway it's only a single file rather than a fileset. 
 
If you come up with something, I'll be very grateful to hear about it. For us Ant addicts, it would be great to be able to populate a Solr index by doing batch xslt transformation followed by batch posts all from an Ant build file.
 
Peter

Re: Posting from Ant

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jan 31, 2007, at 1:56 PM, Binkley, Peter wrote:
> Is there an Ant task out there somewhere that can POST bunches of  
> files
> to Solr, doing what the post.sh script does but with filesets?

Great question.  And you'd think I'd be able to help, but alas I've  
not done this myself.

> I've found the http post task
> (http://antelope.tigris.org/nonav/docs/manual/bk03ch17.html), but it
> just posts name-value pairs, not files; and Slide's set of webdav  
> client
> tasks

This looks like a clone of the ant-contrib task: <http://ant- 
contrib.sourceforge.net/tasks/tasks/index.html>.  The 'file'  
attribute might be able to do the trick, though I'm not quite sure  
from the description.

> (http://gulus.usherbrooke.ca/pub/appl/apache/jakarta/slide/binaries/ 
> jaka
> rta-slide-ant-webdav-bin-2.1.zip) has PUT and GET but not POST. It
> shouldn't be hard to adapt one of these, but something pre-existing
> would be better.

Agreed.  This should be quite do-able, and not too difficult.

I'll poke around some more and see if I can find something suitable.

	Erik