Show / Hide Table of Contents

    Class DocIdSet

    A DocIdSet contains a set of doc ids. Implementing classes must only implement GetIterator() to provide access to the set.

    Inheritance
    System.Object
    DocIdSet
    FieldCacheDocIdSet
    FilteredDocIdSet
    DocIdBitSet
    FixedBitSet
    OpenBitSet
    EliasFanoDocIdSet
    PForDeltaDocIdSet
    WAH8DocIdSet
    Namespace: Lucene.Net.Search
    Assembly: Lucene.Net.dll
    Syntax
    public abstract class DocIdSet : object

    Properties

    | Improve this Doc View Source

    Bits

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

    Declaration
    public virtual 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 null does 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 ). This is generally true for bit sets like FixedBitSet, which return itself if they are used as DocIdSet.

    | Improve this Doc View Source

    IsCacheable

    This method is a hint for CachingWrapperFilter, if this DocIdSet should be cached without copying it. The default is to return false. If you have an own DocIdSet implementation that does its iteration very effective and fast without doing disk I/O, override this property and return true.

    Declaration
    public virtual bool IsCacheable { get; }
    Property Value
    Type Description
    System.Boolean

    Methods

    | Improve this Doc View Source

    GetIterator()

    Provides a DocIdSetIterator to access the set. This implementation can return null if there are no docs that match.

    Declaration
    public abstract DocIdSetIterator GetIterator()
    Returns
    Type Description
    DocIdSetIterator
    | Improve this Doc View Source

    NewAnonymous(Func<DocIdSetIterator>)

    Creates a new instance with the ability to specify the body of the GetIterator() method through the getIterator parameter. Simple example:

        var docIdSet = DocIdSet.NewAnonymous(getIterator: () =>
        {
            OpenBitSet bitset = new OpenBitSet(5);
            bitset.Set(0, 5);
            return new DocIdBitSet(bitset);
        });

    LUCENENET specific

    Declaration
    public static DocIdSet NewAnonymous(Func<DocIdSetIterator> getIterator)
    Parameters
    Type Name Description
    Func<DocIdSetIterator> getIterator

    A delegate method that represents (is called by) the GetIterator() method. It returns the DocIdSetIterator for this DocIdSet.

    Returns
    Type Description
    DocIdSet

    A new Lucene.Net.Search.DocIdSet.AnonymousDocIdSet instance.

    | Improve this Doc View Source

    NewAnonymous(Func<DocIdSetIterator>, Func<IBits>)

    Creates a new instance with the ability to specify the body of the GetIterator() method through the getIterator parameter and the body of the Bits property through the bits parameter. Simple example:

        var docIdSet = DocIdSet.NewAnonymous(getIterator: () =>
        {
            OpenBitSet bitset = new OpenBitSet(5);
            bitset.Set(0, 5);
            return new DocIdBitSet(bitset);
        }, bits: () => 
        {
            return bits;
        });

    LUCENENET specific

    Declaration
    public static DocIdSet NewAnonymous(Func<DocIdSetIterator> getIterator, Func<IBits> bits)
    Parameters
    Type Name Description
    Func<DocIdSetIterator> getIterator

    A delegate method that represents (is called by) the GetIterator() method. It returns the DocIdSetIterator for this DocIdSet.

    Func<IBits> bits

    A delegate method that represents (is called by) the Bits property. It returns the IBits instance for this DocIdSet.

    Returns
    Type Description
    DocIdSet

    A new Lucene.Net.Search.DocIdSet.AnonymousDocIdSet instance.

    | Improve this Doc View Source

    NewAnonymous(Func<DocIdSetIterator>, Func<IBits>, Func<Boolean>)

    Creates a new instance with the ability to specify the body of the GetIterator() method through the getIterator parameter and the body of the Bits property through the bits parameter. Simple example:

        var docIdSet = DocIdSet.NewAnonymous(getIterator: () =>
        {
            OpenBitSet bitset = new OpenBitSet(5);
            bitset.Set(0, 5);
            return new DocIdBitSet(bitset);
        }, bits: () => 
        {
            return bits;
        }, isCacheable: () =>
        {
            return true;
        });

    LUCENENET specific

    Declaration
    public static DocIdSet NewAnonymous(Func<DocIdSetIterator> getIterator, Func<IBits> bits, Func<bool> isCacheable)
    Parameters
    Type Name Description
    Func<DocIdSetIterator> getIterator

    A delegate method that represents (is called by) the GetIterator() method. It returns the DocIdSetIterator for this DocIdSet.

    Func<IBits> bits

    A delegate method that represents (is called by) the Bits property. It returns the IBits instance for this DocIdSet.

    Func<System.Boolean> isCacheable

    A delegate method that represents (is called by) the IsCacheable property. It returns a value.

    Returns
    Type Description
    DocIdSet

    A new Lucene.Net.Search.DocIdSet.AnonymousDocIdSet instance.

    | Improve this Doc View Source

    NewAnonymous(Func<DocIdSetIterator>, Func<Boolean>)

    Creates a new instance with the ability to specify the body of the GetIterator() method through the getIterator parameter and the body of the IsCacheable property through the isCacheable parameter. Simple example:

        var docIdSet = DocIdSet.NewAnonymous(getIterator: () =>
        {
            OpenBitSet bitset = new OpenBitSet(5);
            bitset.Set(0, 5);
            return new DocIdBitSet(bitset);
        }, isCacheable: () =>
        {
            return true;
        });

    LUCENENET specific

    Declaration
    public static DocIdSet NewAnonymous(Func<DocIdSetIterator> getIterator, Func<bool> isCacheable)
    Parameters
    Type Name Description
    Func<DocIdSetIterator> getIterator

    A delegate method that represents (is called by) the GetIterator() method. It returns the DocIdSetIterator for this DocIdSet.

    Func<System.Boolean> isCacheable

    A delegate method that represents (is called by) the IsCacheable property. It returns a value.

    Returns
    Type Description
    DocIdSet

    A new Lucene.Net.Search.DocIdSet.AnonymousDocIdSet instance.

    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)