You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by 122jxgcn <yw...@gmail.com> on 2012/08/13 13:31:30 UTC
How can I let Tika know the resource name?
Hello,
I'm using Solr's ExtractingRequestHandler to let Tika know the name of the
file when indexing.
I'm currently sending HTTP request something like
/update/extract?stream.file=#{filepath}&literal.id=#{filepath}&resource.name=#{resource_name}&commit=true
Will setting the resource.name variable let Tika know the name of the file
so that it can determine Metadata of the file properly?
(for example resource_name = "file.custom" then in Tika,
Metadata.RESOURCE_NAME_KEY becomes "file.custom")
I'm not sure how can I test this so I'm confused.
Thank you.
--
View this message in context: http://lucene.472066.n3.nabble.com/How-can-I-let-Tika-know-the-resource-name-tp4000796.html
Sent from the Apache Tika - Development mailing list archive at Nabble.com.
Re: How can I let Tika know the resource name?
Posted by Dave Meikle <lo...@gmail.com>.
Hi,
On 13 Aug 2012, at 12:31, 122jxgcn <yw...@gmail.com> wrote:
> Hello,
>
> I'm using Solr's ExtractingRequestHandler to let Tika know the name of the
> file when indexing.
> I'm currently sending HTTP request something like
>
> /update/extract?stream.file=#{filepath}&literal.id=#{filepath}&resource.name=#{resource_name}&commit=true
>
> Will setting the resource.name variable let Tika know the name of the file
> so that it can determine Metadata of the file properly?
> (for example resource_name = "file.custom" then in Tika,
> Metadata.RESOURCE_NAME_KEY becomes "file.custom")
> I'm not sure how can I test this so I'm confused.
>
> Thank you.
If you pass the resource name as you are doing in it will be fed into Tika and used as a hint for Mime Type detection. I assume it was Mime Type detection you were looking for.
The best way to see what is happening around metadata - and if what you were trying to pass has made it - is to look at the results of what happens in Extract Only mode[1].
Cheers,
Dave
[1] http://wiki.apache.org/solr/ExtractingRequestHandler#Extract_Only