docs: correct the v2 filter allowlist, date operators, and OSS operator scope
Probing production surfaced three more inaccuracies: - the allowlist row listed 'text' and 'keywords_search', which only exist on the search endpoint, and omitted the get_all-only fields - the time-field table listed 'eq', which every date field rejects with a 400, and omitted 'expiration_date' entirely - the nested AND/OR example filtered categories with a bare string, which the API rejects with "'categories' value must be a dictionary" Also scoped the OSS operator claim to the filter layer: Chroma falls back to equality for contains/icontains and Pinecone maps neither.
This commit is contained in:
@@ -42,9 +42,10 @@ Filters use a nested JSON structure with logical operators at the root:
|
||||
### Time fields
|
||||
| Field | Operators | Example |
|
||||
|-------|-----------|---------|
|
||||
| `created_at` | `gt`, `gte`, `lt`, `lte`, `eq`, `ne` | `{"created_at": {"gte": "2024-01-01"}}` |
|
||||
| `updated_at` | `gt`, `gte`, `lt`, `lte`, `eq`, `ne` | `{"updated_at": {"lt": "2024-12-31"}}` |
|
||||
| `timestamp` | `gt`, `gte`, `lt`, `lte`, `eq`, `ne` | `{"timestamp": {"gt": "2024-01-01"}}` |
|
||||
| `created_at` | `gt`, `gte`, `lt`, `lte`, `ne`, `in`. Explicit `eq` is rejected, pass a bare value instead | `{"created_at": {"gte": "2024-01-01"}}` |
|
||||
| `updated_at` | `gt`, `gte`, `lt`, `lte`, `ne`, `in`. Explicit `eq` is rejected, pass a bare value instead | `{"updated_at": {"lt": "2024-12-31"}}` |
|
||||
| `timestamp` | `gt`, `gte`, `lt`, `lte`, `ne`, `in`. Explicit `eq` is rejected, pass a bare value instead | `{"timestamp": {"gt": "2024-01-01"}}` |
|
||||
| `expiration_date` | `gt`, `gte`, `lt`, `lte`, `ne`, `in`. Explicit `eq` is rejected, pass a bare value instead | `{"expiration_date": {"lte": "2026-12-31"}}` |
|
||||
|
||||
### Content fields
|
||||
| Field | Operators | Example |
|
||||
@@ -421,8 +422,8 @@ A filter object with both an `AND` key and a sibling `OR` key at the same level
|
||||
"AND": [
|
||||
{"user_id": "user_123"},
|
||||
{"OR": [
|
||||
{"categories": "finance"},
|
||||
{"categories": "health"}
|
||||
{"categories": {"in": ["finance"]}},
|
||||
{"categories": {"in": ["health"]}}
|
||||
]}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user