public class FieldSpans
extends Object
Modifier and Type | Class and Description |
---|---|
private class |
FieldSpans.Entry
Stores all the information for a field
|
Modifier and Type | Field and Description |
---|---|
private HashMap |
entries
One
FieldSpans.Entry per field |
Constructor and Description |
---|
FieldSpans() |
Modifier and Type | Method and Description |
---|---|
void |
addSpans(FieldSpans other)
Add matching spans for one or more fields.
|
Set |
getFields()
Get a set of all the field names
|
int |
getSpanCount(String field)
Retrieve the number of spans stored for a given field
|
Span[] |
getSpans(String field)
Retrieve the matching spans for a given field.
|
int |
getSpanTotal(String field)
Retrieve the total number of spans which matched the field
|
Set |
getTerms(String field)
Retrieve the set of search terms for a given field
|
boolean |
isEmpty()
true if no spans have yet been stored
|
void |
recordSpans(String field,
int spanTotal,
Span[] spans,
Set terms)
Record matching spans for a given field.
|
private HashMap entries
FieldSpans.Entry
per fieldpublic void recordSpans(String field, int spanTotal, Span[] spans, Set terms)
field
- field that was matchedspanTotal
- total number of matching spans (which might be more
than we're recording if some low-scoring ones dropped
off the bottom.)spans
- matching spansterms
- set of all search terms on this fieldpublic void addSpans(FieldSpans other)
other
- set of matching spanspublic Set getFields()
public int getSpanTotal(String field)
public int getSpanCount(String field)
public Span[] getSpans(String field)
public Set getTerms(String field)
public boolean isEmpty()