On 8/5/2015 5:38 AM, Dmitry Kan wrote: > Solr: 5.2.1 > class: org.apache.solr.common.util.JavaBinCodec > > I'm working on a custom data structure for the highlighter. The data > structure is ready in JSON and XML formats. I need also JavaBin format. The > data structure is already made serializable by extending the WritableValue > class (methods write and resolve). > > To receive the custom format on the client via solrj api, the data > structure needs to be parseable by JavaBinCodec. Is this correct > assumption? Can we introduce the custom data structure consumer on the > solrj api without complete overhaul of the api? Is there plugin framework > such that JavaBinCodec is extended and used for the new data structure?
The JavaBinCodec class lives in the solr/sorlj/src/java directory. It is already part of SolrJ. The class and the other classes defined inside it are public and not final, so you should be able to extend it and override things as required with no problem in a program that includes SolrJ as well as a custom plugin for Solr. There are a handful of private fields in the class ... if you need your code to deal with any of those, open an issue and make your case. If it is compelling, perhaps some of them can be changed to protected. Is there a problem that's not solved by extending JavaBinCodec? Thanks, Shawn