public class FieldSortedTermVectorMapper extends TermVectorMapper
TermVectorEntry
s
This is not thread-safe.Constructor and Description |
---|
FieldSortedTermVectorMapper(boolean ignoringPositions,
boolean ignoringOffsets,
Comparator<TermVectorEntry> comparator) |
FieldSortedTermVectorMapper(Comparator<TermVectorEntry> comparator) |
Modifier and Type | Method and Description |
---|---|
Comparator<TermVectorEntry> |
getComparator() |
Map<String,SortedSet<TermVectorEntry>> |
getFieldToTerms()
Get the mapping between fields and terms, sorted by the comparator
|
void |
map(String term,
int frequency,
TermVectorOffsetInfo[] offsets,
int[] positions)
Map the Term Vector information into your own structure
|
void |
setExpectations(String field,
int numTerms,
boolean storeOffsets,
boolean storePositions)
Tell the mapper what to expect in regards to field, number of terms, offset and position storage.
|
isIgnoringOffsets, isIgnoringPositions, setDocumentNumber
public FieldSortedTermVectorMapper(Comparator<TermVectorEntry> comparator)
comparator
- A Comparator for sorting TermVectorEntry
spublic FieldSortedTermVectorMapper(boolean ignoringPositions, boolean ignoringOffsets, Comparator<TermVectorEntry> comparator)
public void map(String term, int frequency, TermVectorOffsetInfo[] offsets, int[] positions)
TermVectorMapper
map
in class TermVectorMapper
term
- The term to add to the vectorfrequency
- The frequency of the term in the documentoffsets
- null if the offset is not specified, otherwise the offset into the field of the termpositions
- null if the position is not specified, otherwise the position in the field of the termpublic void setExpectations(String field, int numTerms, boolean storeOffsets, boolean storePositions)
TermVectorMapper
TermVectorMapper.map(String,int,TermVectorOffsetInfo[],int[])
.setExpectations
in class TermVectorMapper
field
- The field the vector is fornumTerms
- The number of terms that need to be mappedstoreOffsets
- true if the mapper should expect offset informationstorePositions
- true if the mapper should expect positions infopublic Map<String,SortedSet<TermVectorEntry>> getFieldToTerms()
SortedSet
s per field. SortedSet entries are TermVectorEntry
public Comparator<TermVectorEntry> getComparator()