Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class FilteredDocIdSet

    Abstract decorator class for a DocIdSet implementation that provides on-demand filtering/validation mechanism on a given DocIdSet.

    Technically, this same functionality could be achieved with ChainedFilter (under queries/), however the benefit of this class is it never materializes the full bitset for the filter. Instead, the Match(int) method is invoked on-demand, per docID visited during searching. If you know few docIDs will be visited, and the logic behind Match(int) is relatively costly, this may be a better way to filter than ChainedFilter.

    Inheritance
    object
    DocIdSet
    FilteredDocIdSet
    BitsFilteredDocIdSet
    Inherited Members
    DocIdSet.NewAnonymous(Func<DocIdSetIterator>)
    DocIdSet.NewAnonymous(Func<DocIdSetIterator>, Func<IBits>)
    DocIdSet.NewAnonymous(Func<DocIdSetIterator>, Func<bool>)
    DocIdSet.NewAnonymous(Func<DocIdSetIterator>, Func<IBits>, Func<bool>)
    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 abstract class FilteredDocIdSet : DocIdSet

    Constructors

    FilteredDocIdSet(DocIdSet)

    Constructor.

    Declaration
    protected FilteredDocIdSet(DocIdSet innerSet)
    Parameters
    Type Name Description
    DocIdSet innerSet

    Underlying DocIdSet

    See Also
    DocIdSet

    Properties

    Bits

    Optionally provides a IBits interface for random access to matching documents.

    Declaration
    public override IBits Bits { get; }
    Property Value
    Type Description
    IBits

    null, if this DocIdSet does not support random access. In contrast to GetIterator(), a return value of nulldoes not imply that no documents match the filter! The default implementation does not provide random access, so you only need to implement this method if your DocIdSet can guarantee random access to every docid in O(1) time without external disk access (as IBits interface cannot throw IOException). This is generally true for bit sets like FixedBitSet, which return itself if they are used as DocIdSet.

    Overrides
    DocIdSet.Bits
    See Also
    DocIdSet

    IsCacheable

    This DocIdSet implementation is cacheable if the inner set is cacheable.

    Declaration
    public override bool IsCacheable { get; }
    Property Value
    Type Description
    bool
    Overrides
    DocIdSet.IsCacheable
    See Also
    DocIdSet

    Methods

    GetIterator()

    Implementation of the contract to build a DocIdSetIterator.

    Declaration
    public override DocIdSetIterator GetIterator()
    Returns
    Type Description
    DocIdSetIterator
    Overrides
    DocIdSet.GetIterator()
    See Also
    DocIdSetIterator
    FilteredDocIdSetIterator

    Match(int)

    Validation method to determine whether a docid should be in the result set.

    Declaration
    protected abstract bool Match(int docid)
    Parameters
    Type Name Description
    int docid

    docid to be tested

    Returns
    Type Description
    bool

    true if input docid should be in the result set, false otherwise.

    See Also
    DocIdSet

    See Also

    DocIdSet
    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.