org.apache.lucene.index
Class PositionBasedTermVectorMapper
- java.lang.Object
-
- org.apache.lucene.index.TermVectorMapper
-
- org.apache.lucene.index.PositionBasedTermVectorMapper
-
public class PositionBasedTermVectorMapper extends TermVectorMapper
For each Field, store position by position information. It ignores frequency information This is not thread-safe.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classPositionBasedTermVectorMapper.TVPositionInfoContainer for a term at a position
-
Constructor Summary
Constructors Constructor and Description PositionBasedTermVectorMapper()PositionBasedTermVectorMapper(boolean ignoringOffsets)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.util.MapgetFieldToTerms()Get the mapping between fields and terms, sorted by the comparatorbooleanisIgnoringPositions()Never ignores positions.voidmap(java.lang.String term, int frequency, TermVectorOffsetInfo[] offsets, int[] positions)Callback for the TermVectorReader.voidsetExpectations(java.lang.String field, int numTerms, boolean storeOffsets, boolean storePositions)Callback mechanism used by the TermVectorReader-
Methods inherited from class org.apache.lucene.index.TermVectorMapper
isIgnoringOffsets, setDocumentNumber
-
-
-
-
Constructor Detail
-
PositionBasedTermVectorMapper
public PositionBasedTermVectorMapper()
-
PositionBasedTermVectorMapper
public PositionBasedTermVectorMapper(boolean ignoringOffsets)
-
-
Method Detail
-
isIgnoringPositions
public boolean isIgnoringPositions()
Never ignores positions. This mapper doesn't make much sense unless there are positions- Overrides:
isIgnoringPositionsin classTermVectorMapper- Returns:
- false
-
map
public void map(java.lang.String term, int frequency, TermVectorOffsetInfo[] offsets, int[] positions)Callback for the TermVectorReader.- Specified by:
mapin classTermVectorMapper- Parameters:
term-frequency-offsets-positions-
-
setExpectations
public void setExpectations(java.lang.String field, int numTerms, boolean storeOffsets, boolean storePositions)Callback mechanism used by the TermVectorReader- Specified by:
setExpectationsin classTermVectorMapper- Parameters:
field- The field being readnumTerms- The number of terms in the vectorstoreOffsets- Whether offsets are availablestorePositions- Whether positions are available
-
getFieldToTerms
public java.util.Map getFieldToTerms()
Get the mapping between fields and terms, sorted by the comparator- Returns:
- A map between field names and a Map. The sub-Map key is the position as the integer, the value is
PositionBasedTermVectorMapper.TVPositionInfo.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG