Class Collector
LUCENENET specific class used to hold the NewAnonymous(Action<Scorer>, Action<Int32>, Action<AtomicReaderContext>, Func<Boolean>) static method.
Inheritance
Namespace: Lucene.Net.Search
Assembly: Lucene.Net.dll
Syntax
public static class Collector : object
Methods
| Improve this Doc View SourceNewAnonymous(Action<Scorer>, Action<Int32>, Action<AtomicReaderContext>, Func<Boolean>)
Creates a new instance with the ability to specify the body of the SetsetScorer
parameter, the body of the Collect(Int32)
method through the collect
parameter, the body of the SetsetNextReader
parameter, and the body of the AcceptsacceptsDocsOutOfOrder
parameter.
Simple example:
IndexSearcher searcher = new IndexSearcher(indexReader);
OpenBitSet bits = new OpenBitSet(indexReader.MaxDoc);
int docBase;
searcher.Search(query,
Collector.NewAnonymous(setScorer: (scorer) =>
{
// ignore scorer
}, collect: (doc) =>
{
bits.Set(doc + docBase);
}, setNextReader: (context) =>
{
docBase = context.DocBase;
}, acceptsDocsOutOfOrder: () =>
{
return true;
})
);
Declaration
public static ICollector NewAnonymous(Action<Scorer> setScorer, Action<int> collect, Action<AtomicReaderContext> setNextReader, Func<bool> acceptsDocsOutOfOrder)
Parameters
Type | Name | Description |
---|---|---|
Action<Scorer> | setScorer | A delegate method that represents (is called by) the Set |
Action<System. |
collect | A delegate method that represents (is called by) the Collect(Int32)
method. It accepts an |
Action<Atomic |
setNextReader | A delegate method that represents (is called by) the Set |
Func<System. |
acceptsDocsOutOfOrder | A delegate method that represents (is called by) the Accepts |
Returns
Type | Description |
---|---|
ICollector | A new Lucene. |