lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan McKinley <ryan...@gmail.com>
Subject Re: ContentStreamUpdateRequest method addFile in 4.0 release.
Date Fri, 08 Jun 2012 16:54:24 GMT
for the ExtractingRequestHandler, you can put anything into the
request contentType.

try:
addFile( file, "application/octet-stream" )

but anything should work

ryan




On Thu, Jun 7, 2012 at 2:32 PM, Koorosh Vakhshoori
<kvakhshoori@gmail.com> wrote:
> In latest 4.0 release, the addFile() method has a new argument 'contentType':
>
> addFile(File file, String contentType)
>
> In context of Solr Cell how should addFile() method be called? Specifically
> I refer to the Wiki example:
>
> ContentStreamUpdateRequest up = new
> ContentStreamUpdateRequest("/update/extract");
> up.addFile(new File("mailing_lists.pdf"));
> up.setParam("literal.id", "mailing_lists.pdf");
> up.setAction(AbstractUpdateRequest.ACTION.COMMIT, true, true);
> result = server.request(up);
> assertNotNull("Couldn't upload mailing_lists.pdf", result);
> rsp = server.query( new SolrQuery( "*:*") );
> Assert.assertEquals( 1, rsp.getResults().getNumFound() );
>
> given at URL: http://wiki.apache.org/solr/ExtractingRequestHandler
>
> Since Solr Cell is calling Tika under the hood, doesn't the file
> content-type is already identified by Tika? Looking at the code, it seems
> passing NULL would do the job, is that correct? Also for Solr Cell, is the
> ContentStreamUpdateRequest class is the right one to use or there is a
> different class that is more appropriate here?
>
> Thanks
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/ContentStreamUpdateRequest-method-addFile-in-4-0-release-tp3988344.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message