Class DocIdSet
A DocIdSet contains a set of doc ids. Implementing classes must only implement GetIterator() to provide access to the set.
Inheritance
Inherited Members
Namespace: Lucene.Net.Search
Assembly: Lucene.Net.dll
Syntax
public abstract class DocIdSet
Properties
| Improve this Doc View SourceBits
Optionally provides a IBits interface for random access to matching documents.
Declaration
public virtual IBits Bits { get; }
Property Value
Type | Description |
---|---|
IBits |
|
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 SourceGetIterator()
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 |
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 |
---|---|---|
System.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. |
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 |
---|---|---|
System.Func<DocIdSetIterator> | getIterator | A delegate method that represents (is called by) the GetIterator() method. It returns the DocIdSetIterator for this DocIdSet. |
System.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. |
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 |
---|---|---|
System.Func<DocIdSetIterator> | getIterator | A delegate method that represents (is called by) the GetIterator() method. It returns the DocIdSetIterator for this DocIdSet. |
System.Func<IBits> | bits | A delegate method that represents (is called by) the Bits property. It returns the IBits instance for this DocIdSet. |
System.Func<System.Boolean> | isCacheable | A delegate method that represents (is called by) the IsCacheable property. It returns a System.Boolean value. |
Returns
Type | Description |
---|---|
DocIdSet | A new Lucene.Net.Search.DocIdSet.AnonymousDocIdSet instance. |
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 |
---|---|---|
System.Func<DocIdSetIterator> | getIterator | A delegate method that represents (is called by) the GetIterator() method. It returns the DocIdSetIterator for this DocIdSet. |
System.Func<System.Boolean> | isCacheable | A delegate method that represents (is called by) the IsCacheable property. It returns a System.Boolean value. |
Returns
Type | Description |
---|---|
DocIdSet | A new Lucene.Net.Search.DocIdSet.AnonymousDocIdSet instance. |