public class

FieldSortedTermVectorMapper

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

Class Overview

For each Field, store a sorted collection of TermVectorEntrys

This is not thread-safe.

Summary

Public Constructors
FieldSortedTermVectorMapper(Comparator<TermVectorEntry> comparator)
FieldSortedTermVectorMapper(boolean ignoringPositions, boolean ignoringOffsets, Comparator<TermVectorEntry> comparator)
Public Methods
Comparator<TermVectorEntry> getComparator()
Map<StringSortedSet<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.
[Expand]
Inherited Methods
From class org.apache.lucene.index.TermVectorMapper
From class java.lang.Object

Public Constructors

public FieldSortedTermVectorMapper (Comparator<TermVectorEntry> comparator)

Parameters
comparator A Comparator for sorting TermVectorEntrys

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

Public Methods

public Comparator<TermVectorEntry> getComparator ()

public Map<StringSortedSet<TermVectorEntry>> getFieldToTerms ()

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

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 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)

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