org.apache.lucene.codecs.lucene40
Class Lucene40TermVectorsFormat

java.lang.Object
  extended by org.apache.lucene.codecs.TermVectorsFormat
      extended by org.apache.lucene.codecs.lucene40.Lucene40TermVectorsFormat

public class Lucene40TermVectorsFormat
extends TermVectorsFormat

Lucene 4.0 Term Vectors format.

Term Vector support is an optional on a field by field basis. It consists of 3 files.

  1. The Document Index or .tvx file.

    For each document, this stores the offset into the document data (.tvd) and field data (.tvf) files.

    DocumentIndex (.tvx) --> Header,<DocumentPosition,FieldPosition> NumDocs

  2. The Document or .tvd file.

    This contains, for each document, the number of fields, a list of the fields with term vector info and finally a list of pointers to the field information in the .tvf (Term Vector Fields) file.

    The .tvd file is used to map out the fields that have term vectors stored and where the field information is in the .tvf file.

    Document (.tvd) --> Header,<NumFields, FieldNums, FieldPositions> NumDocs

  3. The Field or .tvf file.

    This file contains, for each field that has a term vector stored, a list of the terms, their frequencies and, optionally, position, offset, and payload information.

    Field (.tvf) --> Header,<NumTerms, Flags, TermFreqs> NumFields

    Notes:


Constructor Summary
Lucene40TermVectorsFormat()
          Sole constructor.
 
Method Summary
 TermVectorsReader vectorsReader(Directory directory, SegmentInfo segmentInfo, FieldInfos fieldInfos, IOContext context)
          Returns a TermVectorsReader to read term vectors.
 TermVectorsWriter vectorsWriter(Directory directory, SegmentInfo segmentInfo, IOContext context)
          Returns a TermVectorsWriter to write term vectors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lucene40TermVectorsFormat

public Lucene40TermVectorsFormat()
Sole constructor.

Method Detail

vectorsReader

public TermVectorsReader vectorsReader(Directory directory,
                                       SegmentInfo segmentInfo,
                                       FieldInfos fieldInfos,
                                       IOContext context)
                                throws IOException
Description copied from class: TermVectorsFormat
Returns a TermVectorsReader to read term vectors.

Specified by:
vectorsReader in class TermVectorsFormat
Throws:
IOException

vectorsWriter

public TermVectorsWriter vectorsWriter(Directory directory,
                                       SegmentInfo segmentInfo,
                                       IOContext context)
                                throws IOException
Description copied from class: TermVectorsFormat
Returns a TermVectorsWriter to write term vectors.

Specified by:
vectorsWriter in class TermVectorsFormat
Throws:
IOException


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