org.apache.lucene.index

## Class SortedTermVectorMapper

- java.lang.Object
- - org.apache.lucene.index.TermVectorMapper
  - - org.apache.lucene.index.SortedTermVectorMapper

-     public class SortedTermVectorMapper
      extends TermVectorMapper

  Store a sorted collection of `TermVectorEntry`s. 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

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `ALL` Stand-in name for the field in `TermVectorEntry`.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SortedTermVectorMapper(boolean ignoringPositions, boolean ignoringOffsets, java.util.Comparator comparator)`
    `SortedTermVectorMapper(java.util.Comparator comparator)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.SortedSet` | `getTermVectorEntrySet()` The TermVectorEntrySet.
    `void` | `map(java.lang.String term, int frequency, TermVectorOffsetInfo[] offsets, int[] positions)` Map the Term Vector information into your own structure
    `void` | `setExpectations(java.lang.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`

- - ### Field Detail

    - #### ALL

          public static final java.lang.String ALL

      Stand-in name for the field in `TermVectorEntry`.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SortedTermVectorMapper

          public SortedTermVectorMapper(java.util.Comparator comparator)

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

    - #### SortedTermVectorMapper

          public SortedTermVectorMapper(boolean ignoringPositions,
                                        boolean ignoringOffsets,
                                        java.util.Comparator comparator)

  - ### Method Detail

    - #### map

          public void map(java.lang.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 map
        `frequency` - The frequency of the term
        `offsets` - Offset information, may be null
        `positions` - Position information, may be null

    - #### setExpectations

          public void setExpectations(java.lang.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

    - #### getTermVectorEntrySet

          public java.util.SortedSet 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:
        The SortedSet of `TermVectorEntry`.

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