public class FieldSpanSource
extends Object
Modifier and Type | Class and Description |
---|---|
private static class |
FieldSpanSource.ScoreComparator
Used to sort spans by descending score, then by position
|
private class |
FieldSpanSource.ScoreOrder
Keeps track of the next and previous spans, in score order
|
Modifier and Type | Field and Description |
---|---|
(package private) int |
curDoc |
(package private) String[] |
fields |
(package private) FieldSpanSource.ScoreOrder[] |
scoreOrder |
(package private) SpanRecordingScorer[][] |
scorersPerField |
private static FieldSpanSource.ScoreComparator |
theScoreComparator |
Constructor and Description |
---|
FieldSpanSource(SpanRecordingScorer[] scorers)
Package-private on purpose.
|
Modifier and Type | Method and Description |
---|---|
private void |
addSpans(int doc,
String field,
SpanRecordingScorer[] scorers,
FieldSpans out)
For the given field and list of scorers, calculate (and deduplicate if
necessary) the spans for that field.
|
FieldSpans |
getSpans(int doc)
Retrieve the spans for the given document.
|
String[] fields
SpanRecordingScorer[][] scorersPerField
FieldSpanSource.ScoreOrder[] scoreOrder
int curDoc
private static FieldSpanSource.ScoreComparator theScoreComparator
FieldSpanSource(SpanRecordingScorer[] scorers)
public FieldSpans getSpans(int doc)
doc
- Document to get spans for. Typically, the FieldSpanSource can
only get spans for the most recent document collected.private void addSpans(int doc, String field, SpanRecordingScorer[] scorers, FieldSpans out)
doc
- Document for which spans are being recordedfield
- The field being consideredscorers
- All scorers for that fieldout
- Where to store the resulting spans.