Class CompressingTermVectorsFormat
- java.lang.Object
-
- org.apache.lucene.codecs.TermVectorsFormat
-
- org.apache.lucene.codecs.compressing.CompressingTermVectorsFormat
-
- Direct Known Subclasses:
Lucene42TermVectorsFormat
public class CompressingTermVectorsFormat extends TermVectorsFormat
ATermVectorsFormat
that compresses chunks of documents together in order to improve the compression ratio.
-
-
Constructor Summary
Constructors Constructor Description CompressingTermVectorsFormat(java.lang.String formatName, java.lang.String segmentSuffix, CompressionMode compressionMode, int chunkSize)
Create a newCompressingTermVectorsFormat
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
toString()
TermVectorsReader
vectorsReader(Directory directory, SegmentInfo segmentInfo, FieldInfos fieldInfos, IOContext context)
Returns aTermVectorsReader
to read term vectors.TermVectorsWriter
vectorsWriter(Directory directory, SegmentInfo segmentInfo, IOContext context)
Returns aTermVectorsWriter
to write term vectors.
-
-
-
Constructor Detail
-
CompressingTermVectorsFormat
public CompressingTermVectorsFormat(java.lang.String formatName, java.lang.String segmentSuffix, CompressionMode compressionMode, int chunkSize)
Create a newCompressingTermVectorsFormat
.formatName
is the name of the format. This name will be used in the file formats to performcodec 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 twoCompressingTermVectorsFormat
s that have the same name but differentCompressionMode
s.chunkSize
is the minimum byte size of a chunk of documents. Higher values ofchunkSize
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).- Parameters:
formatName
- the name of theStoredFieldsFormat
segmentSuffix
- a suffix to append to files created by this formatcompressionMode
- theCompressionMode
to usechunkSize
- the minimum number of bytes of a single chunk of stored documents- See Also:
CompressionMode
-
-
Method Detail
-
vectorsReader
public final TermVectorsReader vectorsReader(Directory directory, SegmentInfo segmentInfo, FieldInfos fieldInfos, IOContext context) throws java.io.IOException
Description copied from class:TermVectorsFormat
Returns aTermVectorsReader
to read term vectors.- Specified by:
vectorsReader
in classTermVectorsFormat
- Throws:
java.io.IOException
-
vectorsWriter
public final TermVectorsWriter vectorsWriter(Directory directory, SegmentInfo segmentInfo, IOContext context) throws java.io.IOException
Description copied from class:TermVectorsFormat
Returns aTermVectorsWriter
to write term vectors.- Specified by:
vectorsWriter
in classTermVectorsFormat
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-