# A filter in front of the index

Published 2025-09-15 · Topics: Data structures, Vector search

A probabilistic filter that answers most misses before the index is touched.

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.

[All articles](https://danielealbano.me/blog)

## Building something with RAG, search or AI? Write to me.

[Open the contact form](https://danielealbano.me/contact)

---

Every page of this site is available in Markdown: request its URL with the header `Accept: text/markdown`.
