public class

SortedTermVectorMapper

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

Class Overview

Store a sorted collection of TermVectorEntrys. Collects all term information into a single, SortedSet.
NOTE: This Mapper ignores all Field information for the Document. This means that if you are using offset/positions you will not know what Fields they correlate with.
This is not thread-safe

Summary

Constants
String ALL Stand-in name for the field in TermVectorEntry.
Public Constructors
SortedTermVectorMapper(Comparator<TermVectorEntry> comparator)
SortedTermVectorMapper(boolean ignoringPositions, boolean ignoringOffsets, Comparator<TermVectorEntry> comparator)
Public Methods
SortedSet<TermVectorEntry> getTermVectorEntrySet()
The TermVectorEntrySet.
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.
[Expand]
Inherited Methods
From class org.apache.lucene.index.TermVectorMapper
From class java.lang.Object

Constants

public static final String ALL

Stand-in name for the field in TermVectorEntry.

Constant Value: "_ALL_"

Public Constructors

public SortedTermVectorMapper (Comparator<TermVectorEntry> comparator)

Parameters
comparator A Comparator for sorting TermVectorEntrys

public SortedTermVectorMapper (boolean ignoringPositions, boolean ignoringOffsets, Comparator<TermVectorEntry> comparator)

Public Methods

public SortedSet<TermVectorEntry> getTermVectorEntrySet ()

The TermVectorEntrySet. A SortedSet of TermVectorEntry objects. Sort is by the comparator passed into the constructor.
This set will be empty until after the mapping process takes place.

Returns

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

Map the Term Vector information into your own structure

Parameters
term The term to map
frequency The frequency of the term
offsets Offset information, may be null
positions Position information, may be null

public 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. This method will be called once before retrieving the vector for a field. This method will be called before map(String, int, TermVectorOffsetInfo[], int[]).

Parameters
field The field the vector is for
numTerms The number of terms that need to be mapped
storeOffsets true if the mapper should expect offset information
storePositions true if the mapper should expect positions info