From 3ba552a46b39f849e450a64a3bad7a8cb5e8568a Mon Sep 17 00:00:00 2001 From: Peter Broadhurst Date: Tue, 3 Oct 2023 16:41:45 -0400 Subject: [PATCH] Add docs for AND/OR option Signed-off-by: Peter Broadhurst --- docs/reference/api_query_syntax.md | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/docs/reference/api_query_syntax.md b/docs/reference/api_query_syntax.md index 79355f4f97..d74b2515e5 100644 --- a/docs/reference/api_query_syntax.md +++ b/docs/reference/api_query_syntax.md @@ -66,11 +66,13 @@ perform against the match string. Modifiers can appear before the operator, to change its behavior. -| Modifier | Description | -|----------|------------------------------------| -| `!` | Not - negates the match | -| `:` | Case insensitive | -| `?` | Treat empty match string as null | +| Modifier | Description | +|----------|------------------------------------------------| +| `!` | Not - negates the match | +| `:` | Case insensitive | +| `?` | Treat empty match string as null | +| `[` | Combine using `AND` on the same field | +| `]` | Combine using `OR` on the same field (default) | ## Detailed examples @@ -88,3 +90,17 @@ behavior. | `!$-cat` | Does not end with "-cat" | | `?=` | Is null | | `!?=` | Is not null | + +## Time range example + +For this case we need to combine multiple queries on the same `created` +field using AND semantics (with the `[`) modifier: + +``` +?created=[>>2021-01-01T00:00:00Z&created=[<=2021-01-02T00:00:00Z +``` + +So this means: +- `created` greater than `2021-01-01T00:00:00Z` +- `AND` +- `created` less than or equal to `2021-01-02T00:00:00Z` \ No newline at end of file