Lucene.Net
3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
|
An alternative to BooleanScorer that also allows a minimum number of optional scorers that should match.
Implements skipTo(), and has no limitations on the numbers of added scorers.
Uses ConjunctionScorer, DisjunctionScorer, ReqOptScorer and ReqExclScorer.
More...
Inherits Lucene.Net.Search.Scorer.
Public Member Functions | |
BooleanScorer2 (Similarity similarity, int minNrShouldMatch, System.Collections.Generic.List< Scorer > required, System.Collections.Generic.List< Scorer > prohibited, System.Collections.Generic.List< Scorer > optional) | |
Creates a Scorer with the given similarity and lists of required, prohibited and optional scorers. In no required scorers are added, at least one of the optional scorers will have to match during the search. | |
override void | Score (Collector collector) |
Scores and collects all matching documents. | |
override bool | Score (Collector collector, int max, int firstDocID) |
Expert: Collects matching documents in a range. Hook for optimization. Note, firstDocID is added to ensure that DocIdSetIterator.NextDoc() was called before this method. | |
override int | DocID () |
Returns the following:
| |
override int | NextDoc () |
Advances to the next document in the set and returns the doc it is currently on, or NO_MORE_DOCS if there are no more docs in the set. | |
override float | Score () |
Returns the score of the current document matching the query. Initially invalid, until DocIdSetIterator.NextDoc() or DocIdSetIterator.Advance(int) is called the first time, or when called from within Collector.Collect(int). | |
override int | Advance (int target) |
Advances to the first beyond the current whose document number is greater than or equal to target. Returns the current document number or NO_MORE_DOCS if there are no more docs in the set. Behaves as if written: | |
Additional Inherited Members | |
Static Public Attributes inherited from Lucene.Net.Search.DocIdSetIterator | |
static readonly int | NO_MORE_DOCS = System.Int32.MaxValue |
When returned by NextDoc(), Advance(int) and DocID() it means there are no more docs in the iterator. | |
Properties inherited from Lucene.Net.Search.Scorer | |
virtual Similarity | Similarity [get] |
Returns the Similarity implementation used by this scorer. | |
An alternative to BooleanScorer that also allows a minimum number of optional scorers that should match.
Implements skipTo(), and has no limitations on the numbers of added scorers.
Uses ConjunctionScorer, DisjunctionScorer, ReqOptScorer and ReqExclScorer.
Definition at line 31 of file BooleanScorer2.cs.
Lucene.Net.Search.BooleanScorer2.BooleanScorer2 | ( | Similarity | similarity, |
int | minNrShouldMatch, | ||
System.Collections.Generic.List< Scorer > | required, | ||
System.Collections.Generic.List< Scorer > | prohibited, | ||
System.Collections.Generic.List< Scorer > | optional | ||
) |
Creates a Scorer with the given similarity and lists of required, prohibited and optional scorers. In no required scorers are added, at least one of the optional scorers will have to match during the search.
similarity | The similarity to be used. |
minNrShouldMatch | The minimum number of optional added scorers that should match during the search. In case no required scorers are added, at least one of the optional scorers will have to match during the search. |
required | the list of required scorers. |
prohibited | the list of prohibited scorers. |
optional | the list of optional scorers. |
Definition at line 186 of file BooleanScorer2.cs.
|
virtual |
Advances to the first beyond the current whose document number is greater than or equal to target. Returns the current document number or NO_MORE_DOCS if there are no more docs in the set. Behaves as if written:
int advance(int target) { int doc; while ((doc = nextDoc()) < target) { } return doc; }
Some implementations are considerably more efficient than that.
NOTE: certain implemenations may return a different value (each time) if called several times in a row with the same target.
NOTE: this method may be called with NO_MORE_DOCS for efficiency by some Scorers. If your implementation cannot efficiently determine that it should exhaust, it is recommended that you check for that value in each call to this method.
NOTE: after the iterator has exhausted you should not call this method, as it may result in unpredicted behavior.
<since>2.9</since>
Implements Lucene.Net.Search.DocIdSetIterator.
Definition at line 407 of file BooleanScorer2.cs.
|
virtual |
Returns the following:
Implements Lucene.Net.Search.DocIdSetIterator.
Definition at line 390 of file BooleanScorer2.cs.
|
virtual |
Advances to the next document in the set and returns the doc it is currently on, or NO_MORE_DOCS if there are no more docs in the set.
NOTE: after the iterator has exhausted you should not call this method, as it may result in unpredicted behavior.
Implements Lucene.Net.Search.DocIdSetIterator.
Definition at line 395 of file BooleanScorer2.cs.
|
virtual |
Scores and collects all matching documents.
collector | The collector to which all matching documents are passed through. |
Reimplemented from Lucene.Net.Search.Scorer.
Definition at line 369 of file BooleanScorer2.cs.
|
virtual |
Expert: Collects matching documents in a range. Hook for optimization. Note, firstDocID is added to ensure that DocIdSetIterator.NextDoc() was called before this method.
collector | The collector to which all matching documents are passed. |
max | Do not score documents past this. |
firstDocID | The first document ID (ensures DocIdSetIterator.NextDoc() is called before this method. |
Reimplemented from Lucene.Net.Search.Scorer.
Definition at line 378 of file BooleanScorer2.cs.
|
virtual |
Returns the score of the current document matching the query. Initially invalid, until DocIdSetIterator.NextDoc() or DocIdSetIterator.Advance(int) is called the first time, or when called from within Collector.Collect(int).
Implements Lucene.Net.Search.Scorer.
Definition at line 400 of file BooleanScorer2.cs.