Skip to content

Commit 0e3feeb

Browse files
authored
DEV: add annotations for RediSearch v2.10 (#539)
1 parent 81c5033 commit 0e3feeb

File tree

7 files changed

+15
-13
lines changed

7 files changed

+15
-13
lines changed

content/commands/ft.create/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,9 @@ after the SCHEMA keyword, declares which fields to index:
263263

264264
- `WITHSUFFIXTRIE` for `TEXT` and `TAG` attributes, keeps a suffix trie with all terms which match the suffix. It is used to optimize `contains` (*foo*) and `suffix` (*foo) queries. Otherwise, a brute-force search on the trie is performed. If suffix trie exists for some fields, these queries will be disabled for other fields.
265265

266-
- `INDEXEMPTY` for `TEXT` and `TAG` attributes, allows you to index and search for empty strings. By default, empty strings are not indexed.
266+
- `INDEXEMPTY` for `TEXT` and `TAG` attributes, introduced in v2.10, allows you to index and search for empty strings. By default, empty strings are not indexed.
267267

268-
- `INDEXMISSING` for all field types, allows you to search for missing values, that is, documents that do not contain a specific field. Note the difference between a field with an empty value and a document with a missing value. By default, missing values are not indexed.
268+
- `INDEXMISSING` for all field types, introduced in v2.10, allows you to search for missing values, that is, documents that do not contain a specific field. Note the difference between a field with an empty value and a document with a missing value. By default, missing values are not indexed.
269269

270270
</details>
271271

content/commands/ft.search/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,8 @@ Query for polygons which:
788788
- intersect with a given geoshape
789789
- are disjoint (nothing in common) with a given shape
790790

791+
`INTERSECTS` and `DISJOINT` were introduced in v2.10.
792+
791793
First, create an index using `GEOSHAPE` type with a `FLAT` coordinate system:
792794

793795

content/develop/interact/search-and-query/advanced-concepts/stemming.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ redis> HSET wort:4 wort stucke
5454

5555
**Searching for a common stem**
5656

57-
Search for "stuck" (german for "piece"). It's only necessary to specify the `LANGUAGE` argument when it wasn't specified to create the index being used to search.
57+
Search for "stuck" (german for "piece"). As of v2.10, it's only necessary to specify the `LANGUAGE` argument when it wasn't specified to create the index being used to search.
5858
Note the results for words that contains "`ü`" are encoded in UTF-8.
5959

6060
{{< highlight bash >}}

content/develop/interact/search-and-query/advanced-concepts/vectors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Choose the `FLAT` index when you have small datasets (< 1M vectors) or when perf
6666

6767
| Attribute | Description |
6868
|:-------------------|:-----------------------------------------|
69-
| `TYPE` | Vector type (`BFLOAT16`, `FLOAT16`, `FLOAT32`, `FLOAT64`). |
69+
| `TYPE` | Vector type (`BFLOAT16`, `FLOAT16`, `FLOAT32`, `FLOAT64`). `BFLOAT16` and `FLOAT16` require v2.10 or later. |
7070
| `DIM` | The width, or number of dimensions, of the vector embeddings stored in this field. In other words, the number of floating point elements comprising the vector. `DIM` must be a positive integer. The vector used to query this field must have the exact dimensions as the field itself. |
7171
| `DISTANCE_METRIC` | Distance metric (`L2`, `IP`, `COSINE`). |
7272

@@ -95,7 +95,7 @@ Choose the `HNSW` index type when you have larger datasets (> 1M documents) or w
9595

9696
| Attribute | Description |
9797
|:-------------------|:-----------------------------------------|
98-
| `TYPE` | Vector type (`BFLOAT16`, `FLOAT16`, `FLOAT32`, `FLOAT64`). |
98+
| `TYPE` | Vector type (`BFLOAT16`, `FLOAT16`, `FLOAT32`, `FLOAT64`). `BFLOAT16` and `FLOAT16` require v2.10 or later. |
9999
| `DIM` | The width, or number of dimensions, of the vector embeddings stored in this field. In other words, the number of floating point elements comprising the vector. `DIM` must be a positive integer. The vector used to query this field must have the exact dimensions as the field itself. |
100100
| `DISTANCE_METRIC` | Distance metric (`L2`, `IP`, `COSINE`). |
101101

content/develop/interact/search-and-query/indexing/_index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,14 +634,14 @@ This example uses aggregation to calculate a 10% price discount for each item an
634634
{{% /alert %}}
635635

636636
## Index missing or empty values
637-
You can search for missing properties, that is, properties that do not exist in a given document, using the `INDEXMISSING` option to `FT.CREATE` in conjunction with the `ISMISSING` query function with `FT.SEARCH`. You can search for existing properties with no value (i.e., empty) using the `INDEXEMPTY` option with `FT.CREATE`. Both query types require DIALECT 2. Examples below:
637+
As of v2.10, you can search for missing properties, that is, properties that do not exist in a given document, using the `INDEXMISSING` option to `FT.CREATE` in conjunction with the `ismissing` query function with `FT.SEARCH`. You can also search for existing properties with no value (i.e., empty) using the `INDEXEMPTY` option with `FT.CREATE`. Both query types require DIALECT 2. Examples below:
638638

639639
```
640640
JSON.SET key:1 $ '{"propA": "foo"}'
641641
JSON.SET key:2 $ '{"propA": "bar", "propB":"abc"}'
642642
FT.CREATE idx ON JSON PREFIX 1 key: SCHEMA $.propA AS propA TAG $.propB AS propB TAG INDEXMISSING
643643
644-
> FT.SEARCH idx 'ISMISSING(@propB)' DIALECT 2
644+
> FT.SEARCH idx 'ismissing(@propB)' DIALECT 2
645645
1) "1"
646646
2) "key:1"
647647
3) 1) "$"

content/develop/interact/search-and-query/query/exact-match.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ FT.SEARCH index "@field:[value value]"
3838
3939
or
4040
41-
FT.SEARCH index "@field:[value]" DIALECT 2
41+
FT.SEARCH index "@field:[value]" DIALECT 2 # requires v2.10
4242
4343
or
4444
45-
FT.SEARCH index "@field==value" DIALECT 2
45+
FT.SEARCH index "@field==value" DIALECT 2 # requires v2.10
4646
```
4747

4848
As described in the [article about range queries]({{< relref "/develop/interact/search-and-query/query/range" >}}), you can also use the `FILTER` argument:
@@ -58,11 +58,11 @@ FT.SEARCH idx:bicycle "@price:[270 270]"
5858
```
5959

6060
```
61-
FT.SEARCH idx:bicycle "@price:[270]"
61+
FT.SEARCH idx:bicycle "@price:[270]" # requires v2.10
6262
```
6363

6464
```
65-
FT.SEARCH idx:bicycle "@price==270"
65+
FT.SEARCH idx:bicycle "@price==270" # requires v2.10
6666
```
6767

6868
```
@@ -94,7 +94,7 @@ This short example shows you how to query for new bicycles:
9494
FT.SEARCH idx:bicycle "@condition:{new}"
9595
```
9696

97-
Use double quotes and [DIALECT 2]({{< relref "/develop/interact/search-and-query/advanced-concepts/dialects" >}}#dialect-2) for exact match queries involving tags that contain special characters. The only character that needs escaping in queries involving double-quoted tags is the double-quote character. Here's an example of using double-quoted tags that contain special characters:
97+
Use double quotes and [DIALECT 2]({{< relref "/develop/interact/search-and-query/advanced-concepts/dialects" >}}#dialect-2) for exact match queries involving tags that contain special characters. As of v2.10, the only character that needs escaping in queries involving double-quoted tags is the double-quote character. Here's an example of using double-quoted tags that contain special characters:
9898
```
9999
JSON.SET key:1 $ '{"email": "test@redis.com"}'
100100
FT.CREATE idx ON JSON PREFIX 1 key: SCHEMA $.email AS email TAG

content/develop/interact/search-and-query/query/geo-spatial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ FT.SEARCH index "@geo_shape_field:[{WITHIN|CONTAINS|INTERSECTS|DISJOINT} $shape]
5656
Here is a more detailed explanation of this query:
5757

5858
1. **Field name**: you need to replace `geo_shape_field` with the `GEOSHAPE` field's name on which you want to query.
59-
2. **Spatial operator**: spatial operators define the relationship between the shapes in the database and the shape you are searching for. You can either use `WITHIN`, `CONTAINS`, `INTERSECTS`, or `DISJOINT`. `WITHIN` finds any shape in the database that is inside the given shape. `CONTAINS` queries for any shape that surrounds the given shape. `INTERSECTS` finds any shape that has coordinates in common with the provided shape. `DISJOINT` finds any shapes that have nothing in common with the provided shape.
59+
2. **Spatial operator**: spatial operators define the relationship between the shapes in the database and the shape you are searching for. You can either use `WITHIN`, `CONTAINS`, `INTERSECTS`, or `DISJOINT`. `WITHIN` finds any shape in the database that is inside the given shape. `CONTAINS` queries for any shape that surrounds the given shape. `INTERSECTS` finds any shape that has coordinates in common with the provided shape. `DISJOINT` finds any shapes that have nothing in common with the provided shape. `INTERSECTS` and `DISJOINT` were introduced in v2.10.
6060
3. **Parameter**: the query refers to a parameter named `shape`. You can use any parameter name here. You need to use the `PARAMS` clause to set the parameter value. The value follows the [well-known text representation of a geometry](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry). Supported types are `POINT(x y)` and `POLYGON((x1 y1, x2 y2, ...))`.
6161
4. **Dialect**: Shape-based queries have been available since version three of the query dialect.
6262

0 commit comments

Comments
 (0)