public class CompressingTermVectorsFormat extends TermVectorsFormat
TermVectorsFormat
that compresses chunks of documents together in
order to improve the compression ratio.Constructor and Description |
---|
CompressingTermVectorsFormat(String formatName,
String segmentSuffix,
CompressionMode compressionMode,
int chunkSize,
int maxDocsPerChunk,
int blockSize)
Create a new
CompressingTermVectorsFormat . |
Modifier and Type | Method and Description |
---|---|
String |
toString() |
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 CompressingTermVectorsFormat(String formatName, String segmentSuffix, CompressionMode compressionMode, int chunkSize, int maxDocsPerChunk, int blockSize)
CompressingTermVectorsFormat
.
formatName
is the name of the format. This name will be used
in the file formats to perform
codec header checks
.
The compressionMode
parameter allows you to choose between
compression algorithms that have various compression and decompression
speeds so that you can pick the one that best fits your indexing and
searching throughput. You should never instantiate two
CompressingTermVectorsFormat
s that have the same name but
different CompressionMode
s.
chunkSize
is the minimum byte size of a chunk of documents.
Higher values of chunkSize
should improve the compression
ratio but will require more memory at indexing time and might make document
loading a little slower (depending on the size of your OS cache compared
to the size of your index).
formatName
- the name of the StoredFieldsFormat
segmentSuffix
- a suffix to append to files created by this formatcompressionMode
- the CompressionMode
to usechunkSize
- the minimum number of bytes of a single chunk of stored documentsmaxDocsPerChunk
- the maximum number of documents in a single chunkblockSize
- the number of chunks to store in an index block.CompressionMode
public final TermVectorsReader vectorsReader(Directory directory, SegmentInfo segmentInfo, FieldInfos fieldInfos, IOContext context) throws IOException
TermVectorsFormat
TermVectorsReader
to read term
vectors.vectorsReader
in class TermVectorsFormat
IOException
public final TermVectorsWriter vectorsWriter(Directory directory, SegmentInfo segmentInfo, IOContext context) throws IOException
TermVectorsFormat
TermVectorsWriter
to write term
vectors.vectorsWriter
in class TermVectorsFormat
IOException
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.