org.apache.lucene.search
Class FieldSpanSource
Object
FieldSpanSource
public class FieldSpanSource
- extends Object
This class, an instance of which is passed to a SpanHitCollector for each
hit, retrieves FieldSpans when requested. This is performed lazily so that
it can be avoided for hits that don't make the grade.
Method Summary |
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. |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fields
String[] fields
scorersPerField
SpanRecordingScorer[][] scorersPerField
scoreOrder
FieldSpanSource.ScoreOrder[] scoreOrder
curDoc
int curDoc
theScoreComparator
private static FieldSpanSource.ScoreComparator theScoreComparator
FieldSpanSource
FieldSpanSource(SpanRecordingScorer[] scorers)
- Package-private on purpose. Should only be created by RecordingSearcher.
getSpans
public FieldSpans getSpans(int doc)
- Retrieve the spans for the given document.
- Parameters:
doc
- Document to get spans for. Typically, the FieldSpanSource can
only get spans for the most recent document collected.
- Returns:
- Recorded spans for the document.
addSpans
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.
- Parameters:
doc
- Document for which spans are being recordedfield
- The field being consideredscorers
- All scorers for that fieldout
- Where to store the resulting spans.