public class Lucene40TermVectorsFormat extends TermVectorsFormat
Term Vector support is an optional on a field by field basis. It consists of 3 files.
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
CodecHeader
UInt64
(offset in the .tvd file)UInt64
(offset in the .tvf file)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
CodecHeader
VInt
VInt
VLong
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
CodecHeader
VInt
Byte
VInt
String
VInt
VInt
VInt
Byte
NumPayloadBytesVInt
, VInt
>TermFreqNotes:
Constructor and Description |
---|
Lucene40TermVectorsFormat()
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
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. |
public TermVectorsReader vectorsReader(Directory directory, SegmentInfo segmentInfo, FieldInfos fieldInfos, IOContext context) throws IOException
TermVectorsFormat
TermVectorsReader
to read term
vectors.vectorsReader
in class TermVectorsFormat
IOException
public TermVectorsWriter vectorsWriter(Directory directory, SegmentInfo segmentInfo, IOContext context) throws IOException
TermVectorsFormat
TermVectorsWriter
to write term
vectors.vectorsWriter
in class TermVectorsFormat
IOException
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.