Class CompressingStoredFieldsFormat
A StoredFieldsFormat that is very similar to Lucene40StoredFieldsFormat but compresses documents in chunks in order to improve the compression ratio.
For a chunk size of chunkSize
bytes, this StoredFieldsFormat
does not support documents larger than (231 - chunkSize
)
bytes. In case this is a problem, you should use another format, such as
Lucene40StoredFieldsFormat.
For optimal performance, you should use a MergePolicy that returns segments that have the biggest byte size first.
Note
This API is experimental and might change in incompatible ways in the next release.
Inheritance
Inherited Members
Namespace: Lucene.Net.Codecs.Compressing
Assembly: Lucene.Net.dll
Syntax
public class CompressingStoredFieldsFormat : StoredFieldsFormat
Constructors
| Improve this Doc View SourceCompressingStoredFieldsFormat(String, CompressionMode, Int32)
Create a new CompressingStoredFieldsFormat with an empty segment suffix.
Declaration
public CompressingStoredFieldsFormat(string formatName, CompressionMode compressionMode, int chunkSize)
Parameters
Type | Name | Description |
---|---|---|
System.String | formatName | |
CompressionMode | compressionMode | |
System.Int32 | chunkSize |
See Also
| Improve this Doc View SourceCompressingStoredFieldsFormat(String, String, CompressionMode, Int32)
Create a new CompressingStoredFieldsFormat.
formatName
is the name of the format. This name will be used
in the file formats to perform
codec header checks (CheckHeader(DataInput, String, Int32, Int32)).
segmentSuffix
is the segment suffix. this suffix is added to
the result file name only if it's not the empty string.
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
CompressingStoredFieldsFormats that have the same name but
different Lucene.Net.Codecs.Compressing.CompressingStoredFieldsFormat.compressionModes.
chunkSize
is the minimum byte size of a chunk of documents.
A value of 1
can make sense if there is redundancy across
fields. In that case, both performance and compression ratio should be
better than with Lucene40StoredFieldsFormat with compressed
fields.
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).
Declaration
public CompressingStoredFieldsFormat(string formatName, string segmentSuffix, CompressionMode compressionMode, int chunkSize)
Parameters
Type | Name | Description |
---|---|---|
System.String | formatName | The name of the StoredFieldsFormat. |
System.String | segmentSuffix | |
CompressionMode | compressionMode | The CompressionMode to use. |
System.Int32 | chunkSize | The minimum number of bytes of a single chunk of stored documents. |
See Also
Methods
| Improve this Doc View SourceFieldsReader(Directory, SegmentInfo, FieldInfos, IOContext)
Declaration
public override StoredFieldsReader FieldsReader(Directory directory, SegmentInfo si, FieldInfos fn, IOContext context)
Parameters
Type | Name | Description |
---|---|---|
Directory | directory | |
SegmentInfo | si | |
FieldInfos | fn | |
IOContext | context |
Returns
Type | Description |
---|---|
StoredFieldsReader |
Overrides
| Improve this Doc View SourceFieldsWriter(Directory, SegmentInfo, IOContext)
Declaration
public override StoredFieldsWriter FieldsWriter(Directory directory, SegmentInfo si, IOContext context)
Parameters
Type | Name | Description |
---|---|---|
Directory | directory | |
SegmentInfo | si | |
IOContext | context |
Returns
Type | Description |
---|---|
StoredFieldsWriter |
Overrides
| Improve this Doc View SourceToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |