Stage Category: FILTER (Reduces document set)Transformation: N documents → M documents (where M ≤ N, based on conditions)
When to Use
When NOT to Use
Parameters
Simple Mode
Use for single-condition filtering:Boolean Mode
Use for complex multi-condition filtering:Natural-Language Mode
Supply a plain-English filter and let an LLM compile it to a structuredconditions tree at runtime. Useful when the filter shape is derived from user input or when field names are unknown in advance.
NL mode rides the wave — better LLMs produce better filter trees. Takes precedence over simple-mode fields; ignored if
conditions is also set. Adds one LLM call per execution (~200-500ms).Supported Operators
The three
geo_* operators take an object as their value, not a scalar. See Geospatial filtering for the field format and exact value shapes.Configuration Examples
Boolean Conditions
For complex filtering, use theconditions parameter with AND/OR/NOT logic:
Geospatial filtering
Filter documents by geographic location. Three operators —geo_radius,
geo_bounding_box, and geo_polygon — restrict results to documents whose
location falls within a circle, a box, or an arbitrary polygon. They work in
both simple mode and inside boolean conditions, exactly like any other
operator.
The location field
A document is geo-filterable when it carries a location field. By convention the field is namedlocation, and Mixpeek resolves it wherever it lives — it tries
top-level location, then metadata.location, then _internal.metadata.location
— so you write "field": "location" regardless of how the document was ingested.
A location value can be either of two forms:
A document with no location field never matches a geo filter (it is treated
as a non-match, not an error). If a document stores a list of points, it
matches when any point satisfies the filter.
The three operators
radius is always in meters — 15000 is 15 km, not 15,000 km.Combine with a selective filter (recommended)
Geo operators are evaluated by a payload scan — they are correct but not index-accelerated (there is no geo postings index yet). To keep the candidate set small and latency low, pair a geo condition with a selective non-geo condition (a brand, category, or status equality) inside anAND:
eq narrows the set first; the geo condition is then applied to a
small candidate list. Don’t rely on a geo-only filter over a large collection
for sub-millisecond latency.
Validation
Malformed geo specs fail loudly at request time with a message that names the expected shape — you get a clear400, not a silent empty result set.
Common mistakes that are rejected:
valueis not an object (e.g. a bare number or string)center/top_left/bottom_rightmissinglatorlon, or out of rangeradiusmissing or negativegeo_polygonwith fewer than 3 points, or a point missinglat/lon
Worked example
Six documents, each an office with alocation (one has none):
Applying each operator from the examples above:
In every case the Virtual office (no location) is excluded.
First-Stage vs Later-Stage Behavior
First-Stage Example
When no documents exist in the pipeline yet:Later-Stage Example
After semantic search:Performance
Common Pipeline Patterns
Search + Filter + Sort
Attribute-Only Retrieval (No Embeddings)
Multi-Stage Filtering
Comparison: attribute_filter vs feature_search Pre-Filters
Recommendation: When filtering during semantic search, prefer pre-filters in
feature_search. Use attribute_filter for:
- Post-search refinement based on previous stage outputs
- First-stage attribute-only retrieval
- Dynamic filters that depend on earlier stage results
Error Handling
Related Stages
- Feature Search - Semantic vector search
- LLM Filter - Content-based LLM filtering
- Sort Attribute - Sort by field values

