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

Yonik Seeley commented on LUCENE-2649:
--------------------------------------

For the sort-missing-last type of functionality, the current comparator code looks like this (see IntComparator for more context):
{code}
final int v2 = (checkMissing && !cached.valid.get(doc))
? missingValue : cached.values[doc];
{code}
And I was thinking of changing it to this:
{code}
int v2 = cached.values[doc];
if (valid != null && v2==0 && !valid.get(doc))
v2 = missingValue;
{code}

This should make the common case faster by both eliminating an unneeded variable (checkMissing)
and checking that the value is the Java default value before checking the bitset.

Thoughts?
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
Components: Search
Reporter: Ryan McKinley
Assignee: Ryan McKinley
Fix For: 4.0

Attachments: LUCENE-2649-FieldCacheWithBitSet.patch, LUCENE-2649-FieldCacheWithBitSet.patch, LUCENE-2649-FieldCacheWithBitSet.patch, LUCENE-2649-FieldCacheWithBitSet.patch, 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

Search Discussions

  • Ryan McKinley (JIRA) at Dec 6, 2010 at 10:37 pm
    [ https://issues.apache.org/jira/browse/LUCENE-2649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12968458#action_12968458 ]

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

    looks good to me

    bq. we instantiate vals.values lazily for some reason... and then at the end, if it still hasn't been instantiated, we do it anyway?

    I don't know about this, I just copied from the existing code...

    We could make the case where Bits.MatchNoBits( maxDoc ), have a null array. This would make your proposed change invalid though since it checks the array first.


    bq. I'm still trying to grok the logic of calling checkMatchAllBits only if vals.valid == null... seems like it will always return null in that case?

    The assumption is that once vals.valid is set, it should not be recalculated.

    The reasons for the if vals.valie == null in the validate function are:
    - the vals.valid Bits may have been set in fillXXValues
    - the first call may have excluded checkMatchAllBits, and a subsequet call has it set

    Are you asking about in the validate function? If so, fillXXXValues can set the vals.valid, so it does not do it again.

    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
    Components: Search
    Reporter: Ryan McKinley
    Assignee: Ryan McKinley
    Fix For: 4.0

    Attachments: LUCENE-2649-FieldCacheWithBitSet.patch, LUCENE-2649-FieldCacheWithBitSet.patch, LUCENE-2649-FieldCacheWithBitSet.patch, LUCENE-2649-FieldCacheWithBitSet.patch, 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
  • Yonik Seeley (JIRA) at Dec 8, 2010 at 4:30 pm
    [ https://issues.apache.org/jira/browse/LUCENE-2649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12969364#action_12969364 ]

    Yonik Seeley commented on LUCENE-2649:
    --------------------------------------

    bq. looks good to me

    Cool - I'll work up a patch.

    bq. The assumption is that once vals.valid is set, it should not be recalculated.

    Oh, tricky. We should comment that.

    And we can then also change this:
    OpenBitSet validBits = (hasOption(OPTION_CACHE_BITS)) ? new OpenBitSet( maxDoc ) : null;
    To this:
    OpenBitSet validBits = (hasOption(OPTION_CACHE_BITS) && valid.vals==null) ? new OpenBitSet( maxDoc ) : null;
    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
    Components: Search
    Reporter: Ryan McKinley
    Assignee: Ryan McKinley
    Fix For: 4.0

    Attachments: LUCENE-2649-FieldCacheWithBitSet.patch, LUCENE-2649-FieldCacheWithBitSet.patch, LUCENE-2649-FieldCacheWithBitSet.patch, LUCENE-2649-FieldCacheWithBitSet.patch, 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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categorieslucene
postedDec 6, '10 at 10:21p
activeDec 8, '10 at 4:30p
posts3
users1
websitelucene.apache.org

1 user in discussion

Yonik Seeley (JIRA): 3 posts

People

Translate

site design / logo © 2021 Grokbase