Class BloomFilteringPostingsFormat
A Lucene.Net.Codecs.PostingsFormat useful for low doc-frequency fields such as primary keys. Bloom filters are maintained in a ".blm" file which offers "fast-fail" for reads in segments known to have no record of the key. A choice of delegate Lucene.Net.Codecs.PostingsFormat is used to record all other Postings data.
A choice of BloomFilterFactory can be passed to tailor Bloom Filter settings on a per-field basis. The default configuration is DefaultBloomFilterFactory which allocates a ~8mb bitset and hashes values using MurmurHash2. This should be suitable for most purposes.
The format of the blm file is as follows:
- BloomFilter (.blm) --> Header, DelegatePostingsFormatName, NumFilteredFields, FilterNumFilteredFields, Footer
- Filter --> FieldNumber, FuzzySet
- FuzzySet -->See Serialize(DataOutput)
- Header --> CodecHeader (WriteHeader(DataOutput, String, Int32))
- DelegatePostingsFormatName --> String (WriteString(String)) The name of a ServiceProvider registered Lucene.Net.Codecs.PostingsFormat
- NumFilteredFields --> Uint32 (WriteInt32(Int32))
- FieldNumber --> Uint32 (WriteInt32(Int32)) The number of the field in this segment
- Footer --> CodecFooter (WriteFooter(IndexOutput))
Inheritance
Inherited Members
Namespace: Lucene.Net.Codecs.Bloom
Assembly: Lucene.Net.Codecs.dll
Syntax
[PostingsFormatName("BloomFilter")]
public sealed class BloomFilteringPostingsFormat : PostingsFormat
Constructors
| Improve this Doc View SourceBloomFilteringPostingsFormat()
Used only by core Lucene at read-time via Service Provider instantiation - do not use at Write-time in application code.
Declaration
public BloomFilteringPostingsFormat()
BloomFilteringPostingsFormat(PostingsFormat)
Creates Bloom filters for a selection of fields created in the index. This is recorded as a set of Bitsets held as a segment summary in an additional "blm" file. This Lucene.Net.Codecs.PostingsFormat delegates to a choice of delegate Lucene.Net.Codecs.PostingsFormat for encoding all other postings data. This choice of constructor defaults to the DefaultBloomFilterFactory for configuring per-field BloomFilters.
Declaration
public BloomFilteringPostingsFormat(PostingsFormat delegatePostingsFormat)
Parameters
Type | Name | Description |
---|---|---|
Lucene.Net.Codecs.PostingsFormat | delegatePostingsFormat | The Lucene.Net.Codecs.PostingsFormat that records all the non-bloom filter data i.e. postings info. |
BloomFilteringPostingsFormat(PostingsFormat, BloomFilterFactory)
Creates Bloom filters for a selection of fields created in the index. This is recorded as a set of Bitsets held as a segment summary in an additional "blm" file. This Lucene.Net.Codecs.PostingsFormat delegates to a choice of delegate Lucene.Net.Codecs.PostingsFormat for encoding all other postings data.
Declaration
public BloomFilteringPostingsFormat(PostingsFormat delegatePostingsFormat, BloomFilterFactory bloomFilterFactory)
Parameters
Type | Name | Description |
---|---|---|
Lucene.Net.Codecs.PostingsFormat | delegatePostingsFormat | The Lucene.Net.Codecs.PostingsFormat that records all the non-bloom filter data i.e. postings info. |
BloomFilterFactory | bloomFilterFactory | The BloomFilterFactory responsible for sizing BloomFilters appropriately. |
Fields
| Improve this Doc View SourceVERSION_CHECKSUM
Declaration
public static readonly int VERSION_CHECKSUM
Field Value
Type | Description |
---|---|
System.Int32 |
VERSION_CURRENT
Declaration
public static readonly int VERSION_CURRENT
Field Value
Type | Description |
---|---|
System.Int32 |
VERSION_START
Declaration
public static readonly int VERSION_START
Field Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceFieldsConsumer(SegmentWriteState)
Declaration
public override FieldsConsumer FieldsConsumer(SegmentWriteState state)
Parameters
Type | Name | Description |
---|---|---|
Lucene.Net.Index.SegmentWriteState | state |
Returns
Type | Description |
---|---|
Lucene.Net.Codecs.FieldsConsumer |
Overrides
FieldsProducer(SegmentReadState)
Declaration
public override FieldsProducer FieldsProducer(SegmentReadState state)
Parameters
Type | Name | Description |
---|---|---|
Lucene.Net.Index.SegmentReadState | state |
Returns
Type | Description |
---|---|
Lucene.Net.Codecs.FieldsProducer |