Class Lucene50CompressingTermVectorsFormat
- java.lang.Object
-
- org.apache.lucene.codecs.TermVectorsFormat
-
- org.apache.lucene.backward_codecs.lucene50.compressing.Lucene50CompressingTermVectorsFormat
-
- Direct Known Subclasses:
Lucene50TermVectorsFormat
public class Lucene50CompressingTermVectorsFormat extends TermVectorsFormat
ATermVectorsFormatthat compresses chunks of documents together in order to improve the compression ratio.
-
-
Field Summary
Fields Modifier and Type Field Description protected intblockSizeblock sizeprotected intchunkSizechunk sizeprotected CompressionModecompressionModecompression modeprotected java.lang.StringformatNameformat nameprotected intmaxDocsPerChunkmax docs per chunkprotected java.lang.StringsegmentSuffixsegment suffix
-
Constructor Summary
Constructors Constructor Description Lucene50CompressingTermVectorsFormat(java.lang.String formatName, java.lang.String segmentSuffix, CompressionMode compressionMode, int chunkSize, int maxDocsPerChunk, int blockSize)Create a newLucene50CompressingTermVectorsFormat.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringtoString()TermVectorsReadervectorsReader(Directory directory, SegmentInfo segmentInfo, FieldInfos fieldInfos, IOContext context)Returns aTermVectorsReaderto read term vectors.TermVectorsWritervectorsWriter(Directory directory, SegmentInfo segmentInfo, IOContext context)Returns aTermVectorsWriterto write term vectors.
-
-
-
Field Detail
-
formatName
protected final java.lang.String formatName
format name
-
segmentSuffix
protected final java.lang.String segmentSuffix
segment suffix
-
compressionMode
protected final CompressionMode compressionMode
compression mode
-
chunkSize
protected final int chunkSize
chunk size
-
blockSize
protected final int blockSize
block size
-
maxDocsPerChunk
protected final int maxDocsPerChunk
max docs per chunk
-
-
Constructor Detail
-
Lucene50CompressingTermVectorsFormat
public Lucene50CompressingTermVectorsFormat(java.lang.String formatName, java.lang.String segmentSuffix, CompressionMode compressionMode, int chunkSize, int maxDocsPerChunk, int blockSize)Create a newLucene50CompressingTermVectorsFormat.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 twoLucene50CompressingTermVectorsFormats 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 documentsmaxDocsPerChunk- the maximum number of documents in a single chunkblockSize- the number of chunks to store in an index block.- 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:TermVectorsFormatReturns aTermVectorsReaderto read term vectors.- Specified by:
vectorsReaderin classTermVectorsFormat- Throws:
java.io.IOException
-
vectorsWriter
public TermVectorsWriter vectorsWriter(Directory directory, SegmentInfo segmentInfo, IOContext context) throws java.io.IOException
Description copied from class:TermVectorsFormatReturns aTermVectorsWriterto write term vectors.- Specified by:
vectorsWriterin classTermVectorsFormat- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-