Many lookups ask for something that is not there. A filter in front of the index can say so without touching the index at all.
What a Bloom filter promises
A Bloom filter answers "definitely not here" or "possibly here". It never misses a key that was added; it sometimes reports one that was not. That is the right trade in front of an expensive lookup: a false positive costs one wasted lookup, and a true negative saves one.
Sizing it
The rate of false positives depends on the bits per key and the number of hash functions. More bits per key lower it; past a point, more hash functions raise it again, because each key sets more of the bits.
Where it fits in a search
- Before a lookup by exact identifier, to skip identifiers that were never indexed.
- Before a shard, to skip shards that hold none of the requested keys.
- Not before a similarity search: nearness has no exact key to test.