## org.apache.lucene.index
Class PositionBasedTermVectorMapper

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

    public class PositionBasedTermVectorMapper

extends TermVectorMapper

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

This is not thread-safe.

Nested Class Summary
`static class` `PositionBasedTermVectorMapper.TVPositionInfo` Container for a term at a position

Constructor Summary
`PositionBasedTermVectorMapper()`
`PositionBasedTermVectorMapper(boolean ignoringOffsets)`

Method Summary
`java.util.Map` `getFieldToTerms()` Get the mapping between fields and terms, sorted by the comparator
`boolean` `isIgnoringPositions()` Never ignores positions.
`void` `map(java.lang.String term, int frequency, TermVectorOffsetInfo[] offsets, int[] positions)` Callback for the TermVectorReader.
`void` `setExpectations(java.lang.String field, int numTerms, boolean storeOffsets, boolean storePositions)` Callback mechanism used by the TermVectorReader

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

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

Constructor Detail

### PositionBasedTermVectorMapper

    public PositionBasedTermVectorMapper()

### PositionBasedTermVectorMapper

    public PositionBasedTermVectorMapper(boolean ignoringOffsets)

Method Detail

### isIgnoringPositions

    public boolean isIgnoringPositions()

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

  Overrides:
    `isIgnoringPositions` in class `TermVectorMapper`
  Returns:
    false

### map

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

  Callback for the TermVectorReader.

  Specified by:
    `map` in class `TermVectorMapper`
  Parameters:
    `term` -
    `frequency` -
    `offsets` -
    `positions` -

### setExpectations

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

  Callback mechanism used by the TermVectorReader

  Specified by:
    `setExpectations` in class `TermVectorMapper`
  Parameters:
    `field` - The field being read
    `numTerms` - The number of terms in the vector
    `storeOffsets` - Whether offsets are available
    `storePositions` - Whether positions are available

### getFieldToTerms

    public java.util.Map getFieldToTerms()

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

  Returns:
    A map between field names and a Map. The sub-Map key is the position as the integer, the value is `PositionBasedTermVectorMapper.TVPositionInfo`.

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