Ha, yes, that is on my ever growing list of todos. That is slightly different, though, from metadata so I’d want to add a separate endpoint.
Does the format you get with the –J option on tika-app from 1.7-SNAPSHOT work for you? From: Peter Bowyer [mailto:pe...@mapledesign.co.uk] Sent: Thursday, December 18, 2014 10:53 AM To: user@tika.apache.org Subject: Re: Outputting JSON from tika-server/meta If the API is being modified, could we add an endpoint which will return a combined JSON output, like: { "meta" : { ... }, "content" : { "string of content" } } This would save me making two API calls, fetching each individually and loading the document twice. /unpack does something similar, but returns a single file. Peter On 18 December 2014 at 15:42, Chris Mattmann <chris.mattm...@gmail.com<mailto:chris.mattm...@gmail.com>> wrote: Yeah I think we should probably combine them..and make JSON the default (which unfortunately would break back compat, but in my mind would make a lot more sense) ------------------------ Chris Mattmann chris.mattm...@gmail.com<mailto:chris.mattm...@gmail.com> -----Original Message----- From: "Allison, Timothy B." <talli...@mitre.org<mailto:talli...@mitre.org>> Reply-To: <user@tika.apache.org<mailto:user@tika.apache.org>> Date: Thursday, December 18, 2014 at 7:20 AM To: "user@tika.apache.org<mailto:user@tika.apache.org>" <user@tika.apache.org<mailto:user@tika.apache.org>> Subject: RE: Outputting JSON from tika-server/meta >Do you have any luck if you call /metadata instead of /meta? > >That should trigger MetadataEP which will return Json, no? > >I'm not sure why we have both handlers, but we do... > > >-----Original Message----- >From: Sergey Beryozkin >[mailto:sberyoz...@gmail.com<mailto:sberyoz...@gmail.com>] >Sent: Thursday, December 18, 2014 9:56 AM >To: user@tika.apache.org<mailto:user@tika.apache.org> >Subject: Re: Outputting JSON from tika-server/meta > >Hi Peter >Thanks, you are too nice, it is a minor bug :-) >Cheers, Sergey >On 18/12/14 14:50, Peter Bowyer wrote: >> Thanks Sergey, I have opened TIKA-1497 for this enhancement. >> >> Best wishes, >> Peter >> >> On 18 December 2014 at 14:31, Sergey Beryozkin >> <sberyoz...@gmail.com<mailto:sberyoz...@gmail.com> >> <mailto:sberyoz...@gmail.com<mailto:sberyoz...@gmail.com>>> wrote: >> >> Hi, >> I see MetadataResource returning StreamingOutput and it has >> @Produces(text/csv) only. As such this MBW has no effect at the >>moment. >> >> We can update MetadataResource to return Metadata directly if >> application/json is requested or update MetadataResource to directly >> convert Metadata to JSON in case of JSON being accepted >> >> Can you please open a JIRA issue ? >> >> Cheers, Sergey >> >> >> >> On 18/12/14 13:58, Peter Bowyer wrote: >> >> Hi, >> >> I suspect this has a really simple answer, but it's eluding me. >> >> How do I get the response from >> curl -X PUT -T /path/to/file.pdf http://localhost:9998/meta >> to be JSON and not CSV? >> >> I've discovered JSONMessageBodyWriter.java >> >>(https://github.com/apache/__tika/blob/__af19f3ea04792cad81b428f1df9f5e__ >>bbb2501913/tika-server/src/__main/java/org/apache/tika/__server/JSONMessa >>geBodyWriter.__java >> >><https://github.com/apache/tika/blob/af19f3ea04792cad81b428f1df9f5ebbb250 >>1913/tika-server/src/main/java/org/apache/tika/server/JSONMessageBodyWrit >>er.java>) >> so I think the functionality is present, tried adding --header >> "Accept: >> application/json" to the cURL call, in line with the >> documentation for >> outputting CSV, but no luck so far. >> >> Many thanks, >> Peter >> >> >> >> >> -- >> Maple Design Ltd >> http://www.mapledesign.co.uk >> <http://www.mapledesign.co.uk/>+44 (0)845 123 >> 8008<tel:%2B44%20%280%29845%20123%208008> >> >> Reg. in England no. 05920531 > > -- Maple Design Ltd http://www.mapledesign.co.uk <http://www.mapledesign.co.uk/>+44 (0)845 123 8008 Reg. in England no. 05920531