Class CompressingTermVectorsFormat
- Direct Known Subclasses:
Lucene42TermVectorsFormat
TermVectorsFormat that compresses chunks of documents together in
order to improve the compression ratio.-
Constructor Summary
ConstructorsConstructorDescriptionCompressingTermVectorsFormat(String formatName, String segmentSuffix, CompressionMode compressionMode, int chunkSize) Create a newCompressingTermVectorsFormat. -
Method Summary
Modifier and TypeMethodDescriptiontoString()final TermVectorsReadervectorsReader(Directory directory, SegmentInfo segmentInfo, FieldInfos fieldInfos, IOContext context) Returns aTermVectorsReaderto read term vectors.final TermVectorsWritervectorsWriter(Directory directory, SegmentInfo segmentInfo, IOContext context) Returns aTermVectorsWriterto write term vectors.
-
Constructor Details
-
CompressingTermVectorsFormat
public CompressingTermVectorsFormat(String formatName, String segmentSuffix, CompressionMode compressionMode, int chunkSize) Create a newCompressingTermVectorsFormat.formatNameis the name of the format. This name will be used in the file formats to performcodec header checks.The
compressionModeparameter 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 twoCompressingTermVectorsFormats that have the same name but differentCompressionModes.chunkSizeis the minimum byte size of a chunk of documents. Higher values ofchunkSizeshould 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 theStoredFieldsFormatsegmentSuffix- a suffix to append to files created by this formatcompressionMode- theCompressionModeto usechunkSize- the minimum number of bytes of a single chunk of stored documents- See Also:
-
-
Method Details
-
vectorsReader
public final TermVectorsReader vectorsReader(Directory directory, SegmentInfo segmentInfo, FieldInfos fieldInfos, IOContext context) throws IOException Description copied from class:TermVectorsFormatReturns aTermVectorsReaderto read term vectors.- Specified by:
vectorsReaderin classTermVectorsFormat- Throws:
IOException
-
vectorsWriter
public final TermVectorsWriter vectorsWriter(Directory directory, SegmentInfo segmentInfo, IOContext context) throws IOException Description copied from class:TermVectorsFormatReturns aTermVectorsWriterto write term vectors.- Specified by:
vectorsWriterin classTermVectorsFormat- Throws:
IOException
-
toString
-