This is the second release of Redis Stack version 7.2.0.
Headlines:
This version contains a new capability - Triggers and Functions, improvements to the Search and Query capability, and improvements to the JSON, time series and probabilistic data structures. It also includes the latest version of RedisInsight.
The new Search and Query version introduces new and frequently asked Geo Polygon Search. Adding the GEOSHAPE
field type that supports polygon shapes using WKT notation. Besides the current GEO
(alias for GEOPOINT
) used already geo range queries, we add the support for POLYGON
as new shapes. In addition, it brings improvements in performance for SORT BY
operations using FT.SEARCH
and FT.AGGREGATE
.
This release includes a new capability - Triggers and Functions that brings the ability to execute and trigger business logic inside Redis using JavaScript (JS). Detailed documentation and examples can be found in this GitHub repository. The Triggers and Functions commands are aligned with the Redis Functions command. The API is not yet final and might change based on feedback. Any feedback is highly appreciated.
Details:
Features
-
Search and Query:
- #3553 Introduce support for Geo-polygon shapes and queries
- #3476, #3660 Adding
GEOSHAPE
field type to map polygons in theSCHEMA
onFT.CREATE
. - Support for polygons
POLYGON
using WKT notation, for examplePOLYGON((x1 y1, x2 y2, ...))
. - #3556 Adjust the query syntax on
FT.SEARCH
for Polygons using the predicate@geom:[OPERATOR $poly]
and defining polygon in WKT format asPARAMS 2 poly "POLYGON((10 20, ...))"
usingDIALECT 3
. - Initially
WITHIN
andCONTAINS
operators withGEOSHAPES
for now. - #3645 Support multiple coordinate systems cartesian (X,Y) and geographic (lon, lat). Geographic coordinate system using spherical indexing as default (
SPHERICAL
).
- #3476, #3660 Adding
- #3046 Introduce performance optimization for sorting operations on
FT.SEARCH
andFT.AGGREGATE
as default onDIALECT 4
. It will improve performance in 4 different scenarios, listed below:- Skip Sorter - applied when there is no sort of any kind. The query can return once it reaches the
LIMIT
requested results. - Partial Range - applied when there is a
SORTBY
a numeric field, with no filter or filter by the same numeric field, the query iterate on a range large enough to satisfy theLIMIT
requested results. - Hybrid - applied when there is a
SORTBY
a numeric field in addition to another non-numeric filter. Some results will get filtered, and the initial range may not be large enough. The iterator then is rewinded with the following ranges, and an additional iteration takes place to collectLIMIT
requested results. - No optimization - If there is a sort by score or by non-numeric field, there is no other option but to retrieve all results and compare their values.
- #3651 Add
WITHCOUNT
argument that allow return accurate counts for the query results with sorting. This operation processes all results in order to get accurate count, being less performant than the optimised option (default behaviour onDIALECT 4
).
- Skip Sorter - applied when there is no sort of any kind. The query can return once it reaches the
- #3553 Introduce support for Geo-polygon shapes and queries
-
JSON:
- #916 Introduce the new
JSON.MERGE
in compliance with RFC 7396, supporting:- Creating new attributes on an existing JSON document
- Updating and replacing values in parent and child attributes
- Deleting existing attributes (giving
null
as value) - Array update - replacing an entire array with the new value.
- #944 Introduce
JSON.MSET
, supporting atomic multiple sets for keys in the same hash slot.
- #916 Introduce the new
-
Triggers and Functions:
- #875 The api_version was added to the library prologue indicating the minimum required API version. Indicating the library works on the specified API version and later minor versions.
#896 Additional optional callback on a KeySpace trigger that can perform read operations exactly when the notification happens. - #910 The JavaScript API is updated to be inline with JavaScript best practices. Registrations of functions and triggers is done with mandatory arguments and a single optional object.
- #935 Ability to load an RDB from a Redis Server with the RedisGears module loaded but NOT used into a Redis Server without the RedisGears module.
- Updated commands:
- #910
TFUNCTION
andTFCALL
is used instead ofRG.FUNCTION
andRG.FCALL
. - #939 The commands are updated to match the Redis Functions commands.
TFCALL
combines the library and function in a single argument with '.' separated. Example:TFCALL <library_name>.<function_name>
. - #900 rated the ability to run functions as a coroutine in
TFCALLASYNC
. Clients rely onTFCALL
to never block shared connections so other commands are not delayed on such connections.
- #910
- #875 The api_version was added to the library prologue indicating the minimum required API version. Indicating the library works on the specified API version and later minor versions.
Improvements
-
Search and Query:
-
Triggers and Functions:
Changed Behavior
- Search and Query:
Bug Fixes
-
Search and Query:
- #3597 Duplicating alias as output name on
FT.AGGREGATE
reducer (REDUCE
argument) isn't return results. - #3654 Added check for
@
prefix onGROUPBY
fields returnig an error instead of wrong results. - #3501 Sorting by 2 or more fields follow the order not ignoring the second argument.
- #3582 Sorter will set lower rank in documents expired during query time, preventing clients to freeze.
- #3597 Duplicating alias as output name on
-
JSON:
- #1025
JSON.TOGGLE
key space notification fix.
- #1025
-
Time series:
-
Triggers and Functions:
- #913 Do not trigger notifications when Redis is loading from a persistence file.
Redis version
Module versions
Recommended Client Libraries
- Java
- Python
- NodeJS
- .NET
- Go
Compatible with the latest RedisInsight. The docker image redis/redis-stack for this version is bundled with RedisInsight 2.26.
Note: version numbers follow the following pattern:
x.y.z-b
x.y
Redis Major versionz
increases with even numbers as a module x.y version increases.b
denotes a patch to Redis or a module (anyz
of Redis or Modules).b
will consist of av
+ numeric value.