weaviate/weaviate · error
invalid 'where' filter: %w
Error message
invalid 'where' filter: %w
What it means
parseWhere validates where-filters with filters.ValidateFilters. Validation errors that would default to 500 are reclassified as a 400 with this 'invalid where filter' message, since a failing filter contract is the caller's fault, not a server fault.
Source
Thrown at adapters/handlers/rest/search/request.go:897
return maxDepth + 1
}
func parseWhere(where *models.WhereFilter, className string, namespacesEnabled bool,
principal *models.Principal, getClass classGetterFunc,
) (*filters.LocalFilter, *APIError) {
if where == nil {
return nil, nil
}
filter, err := filterext.Parse(where, className, namespacesEnabled, principal)
if err != nil {
return nil, &APIError{Status: http.StatusBadRequest, Err: err}
}
if err := filters.ValidateFilters(getClass, filter); err != nil {
apiErr := statusFromError(err)
if apiErr.Status == http.StatusInternalServerError {
apiErr = &APIError{Status: http.StatusBadRequest, Err: fmt.Errorf("invalid 'where' filter: %w", err)}
}
return nil, apiErr
}
return filter, nil
}
// property adapts *models.Property to schema.PropertyInterface for the
// shared nested-property selection.
type property struct {
*models.Property
}
func (p *property) GetName() string {
return p.Name
}
func (p *property) GetNestedProperties() []*models.NestedProperty {View on GitHub (pinned to 75aa4b6d11)
Solutions
- Validate the where clause: correct operator name, value type matching property datatype, and existing indexed property path
- Rebuild the filter using an SDK/client builder to guarantee schema compliance
- GET /v1/schema to confirm property names and datatypes before filtering
Example fix
// before (operand type mismatch: int property with text value)
{"path":["price"],"operator":"like","valueText":"10*"}
// after
{"path":["price"],"operator":"greaterThan","valueInt":10} Defensive patterns
Strategy: validation
Validate before calling
// ensure filter is schema-conformant before sending schema, _ := client.Schema().Getter().Do(ctx) _ = schema // check property exists and operator matches datatype: // e.g. use valueInt for int props, valueText for text ops like Like
Try / catch
var apiErr *graphql.ApiError
if errors.As(err, &apiErr) && strings.Contains(apiErr.Error(), "invalid 'where' filter") {
// fix the filter client-side; this is a 400, not retryable
} Prevention
- Build filters with SDK builders, not raw JSON strings
- Validate operand types against property datatypes from /v1/schema
- Update filters whenever properties are renamed
When it happens
Trigger: Aggregate or Get requests with a where clause using an unknown operator, wrong operand types for the property, filtering on a non-indexed/non-existent property, or a structurally malformed filter.
Common situations: Using Equal on a nested/reference path incorrectly; applying text operators (Like) to int properties; filter built by hand-rolled JSON missing operator or operands; property renamed in schema but query not updated.
Related errors
- one or more of the roles you want to revoke is empty
- collection name must be provided
- replication factor must be greater than zero
- a valid scale plan with plan ID and collection name must be
- hybrid: selection must be set on the top-level hybrid search
AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04).
Data as JSON: /api/errors/4b5f0716f8e46f53.
Report an issue: GitHub.