You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- OpenSearch query: `internal/infrastructure/opensearch/template.go` (range query with gte/lte)
155
+
- API design: `design/query-svc.go` (Goa design specification)
156
+
- Test coverage: `cmd/service/converters_test.go` (17 comprehensive test cases)
157
+
=======
114
158
## CEL Filter Feature
115
159
116
160
The service supports Common Expression Language (CEL) filtering for post-query resource filtering.
@@ -183,3 +227,4 @@ service := service.NewResourceSearch(mockSearcher, mockAccessChecker, mockFilter
183
227
### Important Limitations
184
228
185
229
**Pagination**: CEL filters apply only to results from each OpenSearch page. If the target resource is not in the first page of OpenSearch results, it won't be found even if it matches the CEL filter. Always use specific primary search criteria (`type`, `name`, `parent`) to narrow OpenSearch results first.
Filter resources updated between two dates (date-only format):
256
+
257
+
```bash
258
+
GET /query/resources?v=1&date_field=updated_at&date_from=2025-01-10&date_to=2025-01-28
259
+
Authorization: Bearer <jwt_token>
260
+
```
261
+
262
+
Filter resources with precise datetime filtering (ISO 8601 format):
263
+
264
+
```bash
265
+
GET /query/resources?v=1&date_field=created_at&date_from=2025-01-10T15:30:00Z&date_to=2025-01-28T18:45:00Z
266
+
Authorization: Bearer <jwt_token>
267
+
```
268
+
269
+
Filter resources created after a specific date (open-ended range):
270
+
271
+
```bash
272
+
GET /query/resources?v=1&date_field=created_at&date_from=2025-01-01
273
+
Authorization: Bearer <jwt_token>
274
+
```
275
+
276
+
Combine date filtering with other parameters:
277
+
278
+
```bash
279
+
GET /query/resources?v=1&type=project&tags=active&date_field=updated_at&date_from=2025-01-01&date_to=2025-03-31
280
+
Authorization: Bearer <jwt_token>
281
+
```
282
+
283
+
**Date Format Notes:**
284
+
285
+
-**ISO 8601 datetime format**: `2025-01-10T15:30:00Z` (time is used as provided)
286
+
-**Date-only format**: `2025-01-10` (automatically converted to start/end of day UTC)
287
+
- For `date_from`: Converts to `2025-01-10T00:00:00Z` (start of day)
288
+
- For `date_to`: Converts to `2025-01-10T23:59:59Z` (end of day)
289
+
- All dates are inclusive (uses `gte` and `lte` operators)
290
+
- The `date_field` parameter is automatically prefixed with `"data."` to scope to the resource's data object
291
+
=======
244
292
#### CEL Filter
245
293
246
294
The `cel_filter` query parameter enables advanced filtering of search results using Common Expression Language (CEL). CEL is a non-Turing complete expression language designed for safe, fast evaluation of expressions in performance-critical applications.
@@ -353,6 +401,7 @@ Invalid CEL expressions return a 400 Bad Request with details:
0 commit comments