public class

PositionBasedTermVectorMapper

extends TermVectorMapper
java.lang.Object
   ↳ org.apache.lucene.index.TermVectorMapper
     ↳ org.apache.lucene.index.PositionBasedTermVectorMapper

Class Overview

For each Field, store position by position information. It ignores frequency information

This is not thread-safe.

Summary

Nested Classes
class PositionBasedTermVectorMapper.TVPositionInfo Container for a term at a position  
Public Constructors
PositionBasedTermVectorMapper()
PositionBasedTermVectorMapper(boolean ignoringOffsets)
Public Methods
Map<StringMap<IntegerPositionBasedTermVectorMapper.TVPositionInfo>> getFieldToTerms()
Get the mapping between fields and terms, sorted by the comparator
boolean isIgnoringPositions()
Never ignores positions.
void map(String term, int frequency, TermVectorOffsetInfo[] offsets, int[] positions)
Callback for the TermVectorReader.
void setExpectations(String field, int numTerms, boolean storeOffsets, boolean storePositions)
Callback mechanism used by the TermVectorReader
[Expand]
Inherited Methods
From class org.apache.lucene.index.TermVectorMapper
From class java.lang.Object

Public Constructors

public PositionBasedTermVectorMapper ()

public PositionBasedTermVectorMapper (boolean ignoringOffsets)

Public Methods

public Map<StringMap<IntegerPositionBasedTermVectorMapper.TVPositionInfo>> getFieldToTerms ()

Get the mapping between fields and terms, sorted by the comparator

Returns

public boolean isIgnoringPositions ()

Never ignores positions. This mapper doesn't make much sense unless there are positions

Returns
  • false

public void map (String term, int frequency, TermVectorOffsetInfo[] offsets, int[] positions)

Callback for the TermVectorReader.

Parameters
term The term to add to the vector
frequency The frequency of the term in the document
offsets null if the offset is not specified, otherwise the offset into the field of the term
positions null if the position is not specified, otherwise the position in the field of the term

public void setExpectations (String field, int numTerms, boolean storeOffsets, boolean storePositions)

Callback mechanism used by the TermVectorReader

Parameters
field The field being read
numTerms The number of terms in the vector
storeOffsets Whether offsets are available
storePositions Whether positions are available