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
Copy file name to clipboardExpand all lines: content/develop/interact/search-and-query/basic-constructs/field-and-type-options.md
+56Lines changed: 56 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,11 @@ You can also use the following query syntax to perform more complex numeric quer
66
66
67
67
Geo fields are used to store geographical coordinates such as longitude and latitude. They enable geospatial radius queries, which allow you to implement location-based search functionality in your applications such as finding nearby restaurants, stores, or any other points of interest.
68
68
69
+
Redis Query Engine also supports [geoshape fields](#geoshape-fields) for more advanced
Vector fields are floating-point vectors that are typically generated by external machine learning models. These vectors represent unstructured data such as text, images, or other complex features. Redis Stack allows you to search for similar vectors using vector search algorithms like cosine similarity, Euclidean distance, and inner product. This enables you to build advanced search applications, recommendation systems, or content similarity analysis.
Copy file name to clipboardExpand all lines: content/develop/interact/search-and-query/indexing/_index.md
+8-80Lines changed: 8 additions & 80 deletions
Original file line number
Diff line number
Diff line change
@@ -311,86 +311,14 @@ When JSONPath leads to multiple numerical values:
311
311
-`null` values are skipped
312
312
- Any other value type will cause an indexing failure
313
313
314
-
## Index JSON arrays as GEO
315
-
316
-
Starting with RediSearch v2.6.1, search can be done on an array of geo (geographical) values or on a JSONPath leading to multiple geo values.
317
-
318
-
Prior to RediSearch v2.6.1, only a single geo value was supported per GEO attribute. The geo value was specified using a comma delimited string in the form "longitude,latitude". For example, "15.447083,78.238306".
319
-
320
-
With RediSearch v2.6.1, a JSON array of such geo values is also supported.
321
-
322
-
In order to index multiple geo values, user either a JSONPath leading to a single array of geo values, or a JSONPath leading to multiple geo values, using JSONPath operators such as wildcard, filter, union, array slice, and/or recursive descent.
323
-
324
-
-`null` values are skipped
325
-
- Other values will cause an indexing failure (bool, number, object, array, wrongly formatted GEO string, invalid coordinates)
326
-
327
-
For example, add to the item's list the `vendor_id`, that is, where an item can be physically purchased:
328
-
329
-
```sql
330
-
127.0.0.1:6379>JSON.SET item:1 $ '{"name":"Noise-cancelling Bluetooth headphones","description":"Wireless Bluetooth headphones with noise-cancelling technology","connection":{"wireless":true,"type":"Bluetooth"},"price":99.98,"stock":25,"colors":["black","silver"], "max_level":[60, 70, 80, 90, 100], "vendor_id": [100,300]}'
To index the `vendor_id` numeric array, specify the JSONPath `$.vendor_id` in the `SCHEMA` definition during index creation:
354
-
355
-
356
-
```sql
357
-
127.0.0.1:6379>FT.CREATE itemIdx5 ON JSON PREFIX 1 item: SCHEMA $.vendor_id AS vid NUMERIC
358
-
OK
359
-
```
360
-
361
-
To index the `location` geo array, specify the JSONPath `$.location` in the `SCHEMA` definition during index creation:
362
-
363
-
364
-
```sql
365
-
127.0.0.1:6379>FT.CREATE vendorIdx ON JSON PREFIX 1 vendor: SCHEMA $.location AS loc GEO
366
-
OK
367
-
```
368
-
369
-
Now search for a vendor close to a specific location. For example, a customer is located at geo coordinates 34.5,31.5 and you want to get the vendors that are within the range of 40 km from our location:
2) "{\"name\":\"Wireless earbuds\",\"description\":\"Wireless Bluetooth in-ear headphones\",\"connection\":{\"wireless\":true,\"type\":\"Bluetooth\"},\"price\":64.99,\"stock\":17,\"colors\":[\"black\",\"white\"],\"max_level\":[80,100,120],\"vendor_id\":[100,200]}"
390
-
4) "item:1"
391
-
5) 1) "$"
392
-
2) "{\"name\":\"Noise-cancelling Bluetooth headphones\",\"description\":\"Wireless Bluetooth headphones with noise-cancelling technology\",\"connection\":{\"wireless\":true,\"type\":\"Bluetooth\"},\"price\":99.98,\"stock\":25,\"colors\":[\"black\",\"silver\"],\"max_level\":[60,70,80,90,100],\"vendor_id\":[100,300]}"
393
-
```
314
+
## Index JSON arrays as GEO and GEOSHAPE
315
+
316
+
You can use `GEO` and `GEOSHAPE` fields to store geospatial data,
317
+
such as geographical locations and geometric shapes. See
0 commit comments