public abstract class TermVectorMapper extends Object
IndexReader.getTermFreqVector(int,String)
.
It is up to the implementation to make sure it is thread-safe.Modifier | Constructor and Description |
---|---|
protected |
TermVectorMapper() |
protected |
TermVectorMapper(boolean ignoringPositions,
boolean ignoringOffsets) |
Modifier and Type | Method and Description |
---|---|
boolean |
isIgnoringOffsets() |
boolean |
isIgnoringPositions()
Indicate to Lucene that even if there are positions stored, this mapper is not interested in them and they
can be skipped over.
|
abstract void |
map(String term,
int frequency,
TermVectorOffsetInfo[] offsets,
int[] positions)
Map the Term Vector information into your own structure
|
void |
setDocumentNumber(int documentNumber)
Passes down the index of the document whose term vector is currently being mapped,
once for each top level call to a term vector reader.
|
abstract 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.
|
protected TermVectorMapper()
protected TermVectorMapper(boolean ignoringPositions, boolean ignoringOffsets)
ignoringPositions
- true if this mapper should tell Lucene to ignore positions even if they are storedignoringOffsets
- similar to ignoringPositionspublic abstract void setExpectations(String field, int numTerms, boolean storeOffsets, boolean storePositions)
map(String,int,TermVectorOffsetInfo[],int[])
.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 abstract void map(String term, int frequency, TermVectorOffsetInfo[] offsets, int[] positions)
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 boolean isIgnoringPositions()
public boolean isIgnoringOffsets()
public void setDocumentNumber(int documentNumber)
documentNumber
- index of document currently being mapped