> I'm glad it worked out for you Ben ... if you are interested
> in contributing this code to Apache so that it can be
> included in the main Solr code base, can you open a Jira "New
> Feature" issue and attach this?
> ... make sure to check the "Grant license to ASF for
> inclusion in ASF works" radio button.
>
> One question though -- i haven't had a chance to try your
> code out, but looking at this bit below, it seems like you
> can never get more then the first 10 base64 encoded
> characters of the value back out -- so i'm not clear on why
> you want want to store the binary value in the first place?
At present I'm using a different system to retrieve the documents from
Lucene and only wanted a substr returned so that I could test certain
queries via the Solr admin interface.
Using Lucene as a document repository is only a temporary solution -
although it would be nice to use Solr to add the documents then have a
hook to redirect certain fields to other processes such as a more
scalable document archiving library.
-Ben
>
> : public String toExternal(Fieldable f) {
> : String extFormat = null;
> : log.info("f.isBinary()=" + f.isBinary());
> : if (f.isBinary()) {
> : extFormat = new String(new
> : Base64().encode(f.binaryValue()));
> : }
> : else {
> : extFormat = f.stringValue();
> : }
> : log.info("extFormat.length()=" + extFormat.length());
> : // show only a segment
> : if (extFormat.length() > 10)
> : extFormat = extFormat.substring(0, 10);
> : extFormat = "*** BinaryField " + extFormat + "
> : BinaryField ***";
> : return extFormat;
> : }
>
>
>
> -Hoss
>
>