lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryan McKinley (JIRA)" <j...@apache.org>
Subject [jira] Updated: (LUCENE-2649) FieldCache should include a BitSet for matching docs
Date Fri, 17 Sep 2010 04:56:32 GMT

     [ https://issues.apache.org/jira/browse/LUCENE-2649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ryan McKinley updated LUCENE-2649:
----------------------------------

    Attachment: LUCENE-2649-FieldCacheWithBitSet.patch

This patch replaces the cached primitive[] with a CachedObject.  The object heiarch looks
like this:

{code:java}

    public abstract static class CachedObject { 
    
  }

  public abstract static class CachedArray extends CachedObject {
    public final Bits valid;
    public CachedArray( Bits valid ) {
      this.valid = valid;
    }
  };

  public static final class ByteValues extends CachedArray {
    public final byte[] values;
    public ByteValues( byte[] values, Bits valid ) {
      super( valid );
      this.values = values;
    }
  };
  ...
{code}

Then this @deprecates the getBytes() classes and replaces them with getByteValues()

{code:java}

  public ByteValues getByteValues(IndexReader reader, String field)
  throws IOException;

  public ByteValues getByteValues(IndexReader reader, String field, ByteParser parser)
  throws IOException;
  
{code}

then repeat for all the other types!

All tests pass with this patch, but i have not added any tests for the BitSet (yet)

If people like the general look of this approach, I will clean it up and add some tests, javadoc
cleanup etc


> FieldCache should include a BitSet for matching docs
> ----------------------------------------------------
>
>                 Key: LUCENE-2649
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2649
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Ryan McKinley
>             Fix For: 4.0
>
>         Attachments: LUCENE-2649-FieldCacheWithBitSet.patch
>
>
> The FieldCache returns an array representing the values for each doc.  However there
is no way to know if the doc actually has a value.
> This should be changed to return an object representing the values *and* a BitSet for
all valid docs.

-- 
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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message