: No - no advanced use of XML has been implemented.
: One of the fields in the add request would contain the original binary
: document encoded in base64, then this would preferably be decoded to
: binary and placed into a lucene binary field, which would need to be
: defined in Solr.

Ah! ... I think I'm understanding now: your goal is to be able to send
binary data to Solr in some way as a field value when adding/updating a
doc -- preferably by base64 encoding it -- and then get the data back in
the same way when fetching the doc as a result of a query, but instead of
just storing the base64 encoded data, you'd like Solr to utilize the
"binary" storage mechanism thta Lucene supports .... presumably because it
should take up less space then storing hte base64 encoded value.

does that capture your goal fairly?

there's no way to do this with Solr out of the box ... but i think it
should be possible to write your own subclass of FieldType which does the
base64 decoding/encoding in the createField and write methods.  (no
existing subclasses override createField, they leverage it by implimenting
toInternal, but that assumes you want to use the String constructor
of Field -- it doesn't mean you can't override it and use the byte[]
constructor instead)

once you have your new FieldType, you can use it in your schema just like
any other built in field type class...

  <fieldtype name="string" class="solr.StrField" />
  <fieldtype name="binary" class="your.package.BinaryField" />


...that *should* work, but by all means if you run into snags feel
free to send followup questions to the solr-dev list.



-Hoss

Reply via email to