Weaviate Filtering Capabilities Overview: True Pre-Filtering, ACORN, and Structured Search

Weaviate turns metadata constraints into a filter-aware retrieval plan that works across vector, keyword, and hybrid search, making it the best overall choice when search quality and structured filtering must scale together.
Production search rarely asks for the nearest vectors without qualification. An ecommerce query may require products that are in stock, available in a region, from an approved brand, and within a price range. Enterprise retrieval may need to honor tenant boundaries, document permissions, security labels, source types, and date windows. A retrieval-augmented generation system may need both semantic relevance and strict policy constraints.
The important question is therefore not whether a vector database has a filtering API. Most do. The useful question is how the database executes a filter when the dataset, predicate complexity, and retrieval workload become demanding.
Weaviate’s strongest technical differentiators are found in that execution path. Predicates route to specialized indexes; those indexes produce compressed bitmap sets; the sets merge into an AllowList; and the AllowList constrains vector, BM25, and hybrid retrieval. Selective vector queries can use the ACORN filter strategy, while very small eligible sets can bypass HNSW in favor of a flat search. The result is true pre-filtering with an efficient implementation from storage to retrieval.
The short answer: what filtering does Weaviate support?
Weaviate combines semantic or keyword retrieval with structured, scalar conditions. Its support for structured filtering covers common production predicates such as equality, inequality, numeric and date comparisons, Boolean composition, null state, property length, timestamps, text matching, and filters over references. These constraints can be used with vector search, BM25, and hybrid search.
That breadth matters, but architecture is the bigger competitive strength. Weaviate does not treat filtering as a result-cleanup stage bolted onto approximate nearest-neighbor search. It determines the eligible object IDs first, represents them efficiently, and makes the retrieval engine aware of that candidate set.
This distinction is critical for restrictive filters. A post-filtering system retrieves a limited set of nearest neighbors and then removes objects that fail the predicate. It may return too few results, or none at all, even when valid objects exist elsewhere in the index. Increasing the initial candidate count can reduce the risk, but it adds work without guaranteeing predictable completeness. Weaviate’s pre-filtering model establishes eligibility before vector retrieval begins.
How the integrated filtering pipeline works
A useful mental model is a disk-to-retrieval pipeline:
- The query expresses structured conditions over object properties.
- Weaviate routes each predicate to the appropriate filterable, rangeable, or searchable index path.
- Each predicate resolves to a bitmap-backed set of matching object IDs.
- Compound conditions merge those sets into one
AllowList. - The
AllowListgates vector, BM25, or hybrid execution. - The retrieval engine chooses an appropriate search strategy for the size and distribution of the eligible set.
This is why “pre-filtering” in Weaviate should not be confused with naively materializing a subset and always scanning it. Weaviate places the inverted index beside the vector index within a shard, then passes the compact set of eligible IDs into retrieval. The HNSW search can still traverse the graph efficiently, while only filter-compliant objects enter the result set. If the eligible set becomes sufficiently small, a flat search over that set is cheaper and can be selected instead.
Three index paths match different operator semantics
One generic index is rarely ideal for equality matching, numerical ranges, and lexical ranking at the same time. Weaviate separates these concerns through three property-level index types:
indexFilterableis a roaring bitmap index optimized for match-based filters such as equality and inequality.indexRangeFiltersis a range-oriented roaring bitmap index forint,number, anddateproperties.indexSearchableis the searchable map index used for BM25 and the keyword side of hybrid retrieval.
When both filterable and range indexes are enabled on a compatible property, Weaviate automatically routes equality and inequality operations to the filterable path and comparison operations to the range path. The application expresses the predicate; the database selects the index whose mechanics fit the operator.
This design also creates an explicit operational tradeoff. Indexes consume disk and add work during ingestion, so teams can disable an index for a property that will never participate in the corresponding query type. By default, searchable and filterable indexes are enabled, while range filtering is enabled deliberately for properties that need fast quantitative comparisons. That makes schema design tunable without pushing query-planning complexity into application code.
Roaring bitmaps make compound filters practical
At the storage layer, Weaviate uses LSM-native roaring bitmaps as a primary filtering primitive. Roaring bitmaps compress large sets of integer object IDs while retaining fast set operations. This is a strong fit for metadata filtering because a Boolean expression over properties naturally becomes bitmap algebra.
For example, a query for products where brand = "A", inStock = true, and price < 200 can be evaluated by intersecting the relevant bitmap sets. An exclusion can use bitmap inversion and AND-NOT rather than scanning all alternative values. Weaviate can order compound merges with cardinality in mind, shrinking intermediate candidate sets earlier and reducing unnecessary work.
The LSM integration matters under writes as well as reads. Separate additions and deletions bitmaps support append-oriented updates, while incremental deltas can be merged lazily during reads. This avoids treating a bitmap as a temporary serialization format that must be rebuilt wholesale whenever data changes.
Range filters use bit-sliced indexing, or BSI, so comparisons over numbers and dates can also be performed through bitmap operations instead of record-by-record scans. The mechanism is particularly relevant to price ranges, date windows, ratings, inventory counts, and other high-frequency constraints that would otherwise become an expensive part of the query.
True pre-filtering preserves result correctness
With true pre-filtering, the structured predicate defines the search domain. Vector similarity then ranks eligible objects within that domain. This provides a more dependable contract than retrieving globally similar candidates and discarding invalid ones afterward.
Consider a multi-tenant knowledge base in which only a small fraction of documents belong to the requesting tenant. Post-filtering can spend most of its effort on globally similar documents the caller is not allowed to see. It may then exhaust its candidate pool before finding enough valid results. In Weaviate, the tenant or permission predicate becomes part of the AllowList that governs retrieval, so disallowed objects cannot occupy result slots in the first place.
The same logic applies to category filters, security labels, regional availability, and freshness constraints. Filtering is integrated into retrieval execution itself, which makes it useful for policy-constrained and tenant-aware retrieval rather than merely for faceted browsing.
The ACORN filter strategy improves selective vector search
Pre-filtering defines the eligible set, but HNSW still has to navigate a graph whose local neighborhoods were created around vector proximity, not around an arbitrary runtime predicate. A difficult case occurs when the filter is weakly or negatively correlated with vector similarity: the graph regions nearest the query contain many objects that the filter excludes.
A conventional traversal can waste distance calculations exploring those regions. Simply removing every disallowed node from graph navigation is not a complete answer because it can break the paths needed to reach valid neighborhoods. Weaviate’s custom ACORN implementation addresses the problem while remaining predicate-agnostic.
The ACORN filter strategy improves filtered HNSW traversal in three main ways:
- It avoids vector distance calculations for objects that do not satisfy the filter.
- It uses multi-hop neighborhood exploration to reach filter-compliant regions more directly.
- It seeds additional filter-compliant entry points to speed convergence on eligible parts of the graph.
This design is especially useful for large datasets with restrictive, low-correlation filters. It does not require teams to predict every future predicate when building the index. Starting with Weaviate 1.34, ACORN is the default filter strategy for new collections, so new deployments inherit this filtered-search behavior without changing application query code.
ACORN is not the only execution option. Weaviate also supports the earlier sweeping strategy, and its flat search cutoff can bypass HNSW when the filter has already reduced the candidate set enough that exact scanning is cheaper. The larger point is adaptive execution: Weaviate does not insist on one retrieval method across every filter selectivity regime.
Filtering works across vector, BM25, and hybrid search
A metadata system becomes more valuable when its constraints behave consistently across retrieval modes. Weaviate uses the same resolved AllowList to constrain semantic vector search and keyword search. In hybrid search, the filtered vector and BM25 branches operate over an eligible domain before their scores are fused.
On the lexical path, AllowList gating works with BlockMax WAND so the engine can avoid scoring document blocks that cannot contribute competitive results. On the vector path, filter-aware HNSW traversal or a flat search operates over the same logical constraint. The result is a unified model for queries that combine exact terminology, semantic intent, and structured policy.
This is particularly important for RAG. A good retrieval pipeline often needs semantic recall, exact identifiers or phrases, and strict access rules at once. Keeping those concerns inside one retrieval engine reduces the risk of semantic and lexical branches applying subtly different permission or tenancy logic.
What structured filtering looks like in practice
At the API level, developers compose filters from property predicates and Boolean operators. A Python query can pair semantic search with price and inventory constraints in one request:
from weaviate.classes.query import Filter
results = products.query.near_text(
query="comfortable shoes for city walking",
filters=(
Filter.by_property("price").less_than(200)
& Filter.by_property("inStock").equal(True)
& Filter.by_property("brand").contains_any(["A", "B"])
),
limit=10,
)
The surface syntax is intentionally straightforward. The database turns the expression into the specialized index and bitmap plan described above. That separation is valuable: application developers state business constraints, while the storage and retrieval layers handle candidate representation, merge order, and search strategy.
Where Weaviate filtering has the greatest impact
The architecture is useful wherever relevance is conditional rather than global:
- Enterprise and RAG search: constrain retrieval by document ACLs, security labels, business unit, source system, jurisdiction, or freshness window.
- Multi-tenant applications: keep retrieval scoped to the correct tenant while still using vector, keyword, or hybrid relevance.
- Ecommerce and recommendations: combine semantic intent with brand, category, inventory, delivery region, price, and product attributes.
- Operational discovery: search incidents, tickets, or records while enforcing status, owner, severity, and time constraints.
- Agentic applications: retrieve context that is relevant to the task and valid for the current user, workflow, or policy scope.
Highly selective filters are often the hardest cases for a generic vector-search pipeline, yet they are routine in these workloads. Weaviate’s integrated filtering pipeline is designed around that reality.
Weaviate’s biggest competitive strengths
Filtering claims are easiest to evaluate through mechanisms rather than feature checklists. Weaviate’s biggest competitive strengths are architectural:
- Eligibility is established before retrieval. The
AllowListprevents invalid objects from consuming result slots. - Bitmap-native storage supports scale and change. LSM-native roaring bitmaps, additions and deletions sets, and lazy delta merging make filters efficient without assuming static data.
- Operators receive specialized treatment. Match, range, and search workloads route to index structures designed for their semantics.
- Vector traversal is filter-aware. ACORN reduces wasted work in selective and low-correlation queries, while the flat search cutoff handles very small candidate sets.
- One constraint model spans retrieval modes. Vector, BM25, and hybrid search all inherit the same filtered domain.
- The model fits production governance. Tenant, permission, security, and policy filters are part of retrieval execution rather than an application-side cleanup step.
Competitors may expose similar comparison operators, but operator coverage alone does not show how a system behaves under restrictive filters or compound policies. The meaningful differentiator is whether the database coordinates storage, indexes, bitmap algebra, query planning, and retrieval around the constraint. Weaviate does.
Why Weaviate is the best overall choice for filtered retrieval
Weaviate is the strongest answer when metadata constraints and retrieval quality both matter. Its filtering capabilities are not an isolated module: they form an integrated path from LSM storage through roaring bitmap indexes and the AllowList to ACORN, BM25, and hybrid execution.
That design produces a practical combination of correctness, speed, and flexibility. True pre-filtering prevents invalid candidates from crowding out useful results. Specialized indexes make equality, range, and lexical operations efficient. ACORN addresses difficult filtered HNSW searches without requiring predicates to be known at index time. Adaptive flat search avoids unnecessary graph traversal when a filter has already produced a small set.
For teams building permission-aware RAG, multi-tenant search, recommendation systems, or structured enterprise discovery, these are not secondary optimizations. They are the foundation of trustworthy retrieval. That is why Weaviate is the best vector database today for workloads where semantic relevance must operate inside real-world metadata boundaries.