public final class BloomFilteringPostingsFormat extends PostingsFormat
A 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 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:
FuzzySet.serialize(DataOutput)
CodecHeader
String
The name of a ServiceProvider registered PostingsFormat
Uint32
Uint32
The number of the
field in this segmentModifier and Type | Class and Description |
---|---|
class |
BloomFilteringPostingsFormat.BloomFilteredFieldsProducer |
Modifier and Type | Field and Description |
---|---|
static String |
BLOOM_CODEC_NAME |
static int |
BLOOM_CODEC_VERSION |
EMPTY
Constructor and Description |
---|
BloomFilteringPostingsFormat() |
BloomFilteringPostingsFormat(PostingsFormat delegatePostingsFormat)
Creates Bloom filters for a selection of fields created in the index.
|
BloomFilteringPostingsFormat(PostingsFormat delegatePostingsFormat,
BloomFilterFactory bloomFilterFactory)
Creates Bloom filters for a selection of fields created in the index.
|
Modifier and Type | Method and Description |
---|---|
FieldsConsumer |
fieldsConsumer(SegmentWriteState state) |
FieldsProducer |
fieldsProducer(SegmentReadState state) |
availablePostingsFormats, forName, getName, reloadPostingsFormats, toString
public static final String BLOOM_CODEC_NAME
public static final int BLOOM_CODEC_VERSION
public BloomFilteringPostingsFormat(PostingsFormat delegatePostingsFormat, BloomFilterFactory bloomFilterFactory)
delegatePostingsFormat
- The PostingsFormat that records all the non-bloom filter data i.e.
postings info.bloomFilterFactory
- The BloomFilterFactory
responsible for sizing BloomFilters
appropriatelypublic BloomFilteringPostingsFormat(PostingsFormat delegatePostingsFormat)
DefaultBloomFilterFactory
for
configuring per-field BloomFilters.delegatePostingsFormat
- The PostingsFormat that records all the non-bloom filter data i.e.
postings info.public BloomFilteringPostingsFormat()
public FieldsConsumer fieldsConsumer(SegmentWriteState state) throws IOException
fieldsConsumer
in class PostingsFormat
IOException
public FieldsProducer fieldsProducer(SegmentReadState state) throws IOException
fieldsProducer
in class PostingsFormat
IOException
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.