Class PositionBasedTermVectorMapper


  • public class PositionBasedTermVectorMapper
    extends TermVectorMapper
    For each Field, store position by position information. It ignores frequency information

    This is not thread-safe.

    • 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​(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​(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