I have a servlet that queries a solr database using solrj. The response from the solr server is in javabin format, which is the default. I would like to convert this output to json, and I'm wondering if there is a simple way to do it. Note that solrj does NOT allow json responses, so I cannot simply specify "wt=json" as I would if I were using the REST interface. I've scoured the web, and I haven't really found anything useful. Is there any help for me?
It looks like javabin is a proprietary format created by the Solr project. If they have any forums / support you might ask if they have any tools for translating to more open formats. Barring that, assuming you know how to translate the javabin format into regular Java, you could then use a typical JSON tool to re-translate it from Java to JSON. I think json.org has a library for Java, and there is another one named Jackson (http://wiki.fasterxml.com/JacksonHome) which I hear works well...
Yeah, I think you are correct... I just wanted to make sure there was nothing simple and obvious that I was missing. This might be the best solution anyway, since I will be able to distill the glut of data I get from solr to the handful of fields that my application actually needs.
Not to get too far off-thread, but I opted for json-lib...
Yes, my master! Here is the tiny ad you asked for:
create, convert, edit or print DOC and DOCX in Java