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] Commented: (LUCENE-2649) FieldCache should include a BitSet for matching docs
Date Fri, 17 Sep 2010 15:24:34 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-2649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12910628#action_12910628
] 

Ryan McKinley commented on LUCENE-2649:
---------------------------------------

Uwe: "For DocTerms the approach is not needed..."

Ya I realized this after looking at the patch I first submitted.  In the first patch, the
cache holds a CachedObject rather then just an Object.  In the second, I changed back to just
an Object so it does not need to wrap the DocTerms or DocTermsIndex

For the RangeFilter, with optional Bits calculation, that could would look somethign like:
{code:java}

        LongValues cached = FieldCache.DEFAULT.getLongValues(reader, field, (FieldCache.LongParser)
parser);
        final long[] values = cached.values;
        if( cached.valid == null ) {
          // ignore deleted docs if range doesn't contain 0
          return new FieldCacheDocIdSet(reader, !(inclusiveLowerPoint <= 0L &&
inclusiveUpperPoint >= 0L)) {
            @Override
            boolean matchDoc(int doc) {
              return values[doc] >= inclusiveLowerPoint && values[doc] <= inclusiveUpperPoint;
            }
          };
        }
        else {
          final Bits valid = cached.valid;
          return new FieldCacheDocIdSet(reader, true) {
            @Override
            boolean matchDoc(int doc) {
              return valid.get(doc) && values[doc] >= inclusiveLowerPoint &&
values[doc] <= inclusiveUpperPoint;
            }
          };
        }
{code}

> 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, 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