Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class FilteredQuery.RandomAccessFilterStrategy

    A FilteredQuery.FilterStrategy that conditionally uses a random access filter if the given DocIdSet supports random access (returns a non-null value from Bits) and UseRandomAccess(IBits, int) returns

    true
    . Otherwise this strategy falls back to a "zig-zag join" (

    LEAP_FROG_FILTER_FIRST_STRATEGY) strategy .

    Inheritance
    object
    FilteredQuery.FilterStrategy
    FilteredQuery.RandomAccessFilterStrategy
    Inherited Members
    FilteredQuery.FilterStrategy.FilteredBulkScorer(AtomicReaderContext, Weight, bool, DocIdSet)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Search
    Assembly: Lucene.Net.dll
    Syntax
    public class FilteredQuery.RandomAccessFilterStrategy : FilteredQuery.FilterStrategy

    Methods

    FilteredScorer(AtomicReaderContext, Weight, DocIdSet)

    Returns a filtered Scorer based on this strategy.

    Declaration
    public override Scorer FilteredScorer(AtomicReaderContext context, Weight weight, DocIdSet docIdSet)
    Parameters
    Type Name Description
    AtomicReaderContext context

    the AtomicReaderContext for which to return the Scorer.

    Weight weight

    the FilteredQueryWeight to create the filtered scorer.

    DocIdSet docIdSet

    the filter DocIdSet to apply

    Returns
    Type Description
    Scorer

    a filtered scorer

    Overrides
    FilteredQuery.FilterStrategy.FilteredScorer(AtomicReaderContext, Weight, DocIdSet)
    Exceptions
    Type Condition
    IOException

    if an IOException occurs

    UseRandomAccess(IBits, int)

    Expert: decides if a filter should be executed as "random-access" or not. Random-access means the filter "filters" in a similar way as deleted docs are filtered in Lucene. This is faster when the filter accepts many documents. However, when the filter is very sparse, it can be faster to execute the query+filter as a conjunction in some cases.

    The default implementation returns true if the first document accepted by the filter is < 100.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Declaration
    protected virtual bool UseRandomAccess(IBits bits, int firstFilterDoc)
    Parameters
    Type Name Description
    IBits bits
    int firstFilterDoc
    Returns
    Type Description
    bool
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.