Fork me on GitHub
  • API

    Show / Hide Table of Contents

    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 (Lucene.Net.Codecs.CodecUtil.WriteHeader(Lucene.Net.Store.DataOutput,System.String,System.Int32))
    • DelegatePostingsFormatName --> String (Lucene.Net.Store.DataOutput.WriteString(System.String)) The name of a ServiceProvider registered Lucene.Net.Codecs.PostingsFormat
    • NumFilteredFields --> Uint32 (Lucene.Net.Store.DataOutput.WriteInt32(System.Int32))
    • FieldNumber --> Uint32 (Lucene.Net.Store.DataOutput.WriteInt32(System.Int32)) The number of the field in this segment
    • Footer --> CodecFooter (Lucene.Net.Codecs.CodecUtil.WriteFooter(Lucene.Net.Store.IndexOutput))

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Inheritance
    System.Object
    Lucene.Net.Codecs.PostingsFormat
    BloomFilteringPostingsFormat
    Inherited Members
    Lucene.Net.Codecs.PostingsFormat.EMPTY
    Lucene.Net.Codecs.PostingsFormat.SetPostingsFormatFactory(Lucene.Net.Codecs.IPostingsFormatFactory)
    Lucene.Net.Codecs.PostingsFormat.GetPostingsFormatFactory()
    Lucene.Net.Codecs.PostingsFormat.Name
    Lucene.Net.Codecs.PostingsFormat.ToString()
    Lucene.Net.Codecs.PostingsFormat.ForName(System.String)
    Lucene.Net.Codecs.PostingsFormat.AvailablePostingsFormats
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Lucene.Net.Codecs.Bloom
    Assembly: Lucene.Net.Codecs.dll
    Syntax
    [PostingsFormatName("BloomFilter")]
    public sealed class BloomFilteringPostingsFormat : PostingsFormat

    Constructors

    | Improve this Doc View Source

    BloomFilteringPostingsFormat()

    Used only by core Lucene at read-time via Service Provider instantiation - do not use at Write-time in application code.

    Declaration
    public BloomFilteringPostingsFormat()
    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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 Source

    VERSION_CHECKSUM

    Declaration
    public static readonly int VERSION_CHECKSUM
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    VERSION_CURRENT

    Declaration
    public static readonly int VERSION_CURRENT
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    VERSION_START

    Declaration
    public static readonly int VERSION_START
    Field Value
    Type Description
    System.Int32

    Methods

    | Improve this Doc View Source

    FieldsConsumer(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
    Lucene.Net.Codecs.PostingsFormat.FieldsConsumer(Lucene.Net.Index.SegmentWriteState)
    | Improve this Doc View Source

    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
    Overrides
    Lucene.Net.Codecs.PostingsFormat.FieldsProducer(Lucene.Net.Index.SegmentReadState)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2021 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.