Drew Farris wrote:
Drew, I'm sorry I missed this. Definetely didn't mean to ignore you work! I just assumed that this is still undone. Oops....On Thu, 2004-05-27 at 16:17, Dmitry Serebrennikov wrote:
How about adding binary fields capability to Lucene stored fields? This could be fun and useful, especially if there is a need for this for the project you are directly working on.
Myself and Doug have discussed this last week or so on this list, but I
haven't had time to do it and not sure when I might. It should be a
pretty well contained project. The proposed API can be
found in the messages from last week. I think we came up with a
pretty clean solution that would be relatively easy to add to Lucene,
and that will have little or no effect on the existing applications, and could enable new types of applications, such as encryption and compression of fields. At some point, perhaps even an index-wide compression system, akin to a zip file.
Dmitry,
I send out a patch for this soon after the original discussion (see url
below). Was this what you'd had in mind or did I miss the point
entirely? I'd appreciate any suggestions for improving it.
http://marc.theaimsgroup.com/?l=lucene-dev&m=108465865425455&w=2
Thanks,
Drew.
I just took a look at your patch. Looks great! Simple, and does the trick.
One comment:
- I understand why getBinaryValues(String fieldName) has to return byte[][]. This is to deal with multiple fields with the same name, right? I think this is a relatively rear case, so perhaps it would be good to have a method getBinaryValue(String fieldName) that just returns the first byte[] for a given name. I think you can avoid allocating an array and most applications would find it more convinient.
I'm +1 for including this (provided it works and all :), I have not actually tested it myself).
As far as testing, I think unit tests are enough. It would be good to have a few tests though. One test to have as with a large amount of data.
What happens if there are two fields with the same name but one binary and one not? Will there be an error? If so, when will it be given?
Is it possible to set confliciting flags on a field if one does not use the new Field.Binary method? What happens if this is done?
Can anyone think of other things to test with this feature?
Again, Drew, great work! Thanks for your contribution to Lucene. Sorry to have missed your original message.
Dmitry.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]