lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] Commented: (LUCENE-1219) support array/offset/ length setters for Field with binary data
Date Fri, 08 Aug 2008 15:43:44 GMT


Michael McCandless commented on LUCENE-1219:

Eks, could we instead add this to Field:

  byte[] binaryValue(byte[] result)

and then default the current binaryValue() to just call binaryValue(null)?

And similar in Document add:

  byte[] getBinaryValue(String name, byte[] result)

These would work the same way that result) works, ie, the method should
try to use the result passed in, if it works, and return that; else it's free to allocate
its own new byte[] and return it?

And then only LazyField's implementation of binaryValue(byte[] result) would use byte[] result
if it's large enough?

Also ... it'd be nice to have a way to do this re-use in the non-lazy case.  Ie somehow load
a stored doc, but passing in your own Document result which would attempt to re-use the Field
instances & byte[] for the binary fields.  But we should open another issue to explore

> support array/offset/ length setters for Field with binary data
> ---------------------------------------------------------------
>                 Key: LUCENE-1219
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>            Reporter: Eks Dev
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1219.extended.patch, LUCENE-1219.patch, LUCENE-1219.patch,
LUCENE-1219.patch, LUCENE-1219.patch, LUCENE-1219.take2.patch, LUCENE-1219.take3.patch
> currently Field/Fieldable interface supports only compact, zero based byte arrays. This
forces end users to create and copy content of new objects before passing them to Lucene as
such fields are often of variable size. Depending on use case, this can bring far from negligible
 performance  improvement. 
> this approach extends Fieldable interface with 3 new methods   
> getOffset(); gettLenght(); and getBinaryValue() (this only returns reference to the array)

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message