FieldSortedTermVectorMapper (Lucene 2.4.1 API)
Keywords: org.apache.lucene.index.FieldSortedTermVectorMapper class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.lucene.index
Class FieldSortedTermVectorMapper

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

    public class FieldSortedTermVectorMapper

extends TermVectorMapper

For each Field, store a sorted collection of `TermVectorEntry`s

This is not thread-safe.

Constructor Summary
`FieldSortedTermVectorMapper(boolean ignoringPositions, boolean ignoringOffsets, Comparator comparator)`
`FieldSortedTermVectorMapper(Comparator comparator)`

Method Summary
`Comparator` | `getComparator()`
`Map` | `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.

Methods inherited from class org.apache.lucene.index.TermVectorMapper
`isIgnoringOffsets, isIgnoringPositions, setDocumentNumber`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### FieldSortedTermVectorMapper

    public FieldSortedTermVectorMapper(Comparator comparator)

Parameters:
  `comparator` - A Comparator for sorting `TermVectorEntry`s

### FieldSortedTermVectorMapper

    public FieldSortedTermVectorMapper(boolean ignoringPositions,
                                       boolean ignoringOffsets,
                                       Comparator comparator)

Method Detail

### map

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

  Description copied from class: `TermVectorMapper`
  Map the Term Vector information into your own structure

  Specified by:
    `map` in class `TermVectorMapper`
  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

### setExpectations

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

  Description copied from class: `TermVectorMapper`
  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 `TermVectorMapper.map(String,int,TermVectorOffsetInfo[],int[])`.

  Specified by:
    `setExpectations` in class `TermVectorMapper`
  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

### getFieldToTerms

    public Map getFieldToTerms()

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

  Returns:
    A map between field names and `SortedSet`s per field. SortedSet entries are `TermVectorEntry`

### getComparator

    public Comparator getComparator()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2009 Apache Software Foundation. All Rights Reserved.