public class SpanRecordingScorer extends SpanScorer
Modifier and Type | Field and Description |
---|---|
private String |
field
Field being queried (a Span query can only work on one field
|
private int |
maxSpans
Max # of spans to record (highest scoring are kept, others tossed)
|
(package private) int |
nSpans
Number of spans recorded for this document
|
(package private) int |
nToDedupe
How many spans to de-duplicate
|
(package private) Span[] |
posOrder
Array of recorded spans, in position order
|
(package private) int |
scoredDoc
Last document that was scored
|
(package private) Set |
terms
Set of all search terms
|
(package private) Span[] |
toDedupe
Array to de-dupe, in position order
|
(package private) int |
totalDeduped
Total deduped, not limited by
maxSpans |
Constructor and Description |
---|
SpanRecordingScorer(Spans spans,
SpanWeight weight,
Similarity similarity,
int maxSpans)
Construct a recording scorer.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
advance()
Worker method used by
SpanScorer.next() and
SpanScorer.skipTo(int) . |
private void |
expand()
Enlarge the arrays used to keep track of spans
|
String |
getField() |
int |
getMaxSpans() |
int |
getSpanCount() |
int |
getSpanDoc() |
Span[] |
getSpans() |
Set |
getTerms() |
float |
score() |
doc, explain, next, skipTo
private String field
private int maxSpans
int nSpans
int scoredDoc
int totalDeduped
maxSpans
Span[] posOrder
Span[] toDedupe
int nToDedupe
Set terms
SpanRecordingScorer(Spans spans, SpanWeight weight, Similarity similarity, int maxSpans) throws IOException
spans
- set of spans to processweight
- weight of this querysimilarity
- used to calculate scores, and compare queriesmaxSpans
- max # of spans to collectIOException
protected boolean advance() throws IOException
SpanScorer.next()
and
SpanScorer.skipTo(int)
.advance
in class SpanScorer
IOException
private void expand()
public int getSpanDoc()
public String getField()
public int getSpanCount()
public Span[] getSpans()
public int getMaxSpans()
public Set getTerms()
public float score() throws IOException
score
in class SpanScorer
IOException