From 159b579f94d1403d8c576870a7c76eca377a647e Mon Sep 17 00:00:00 2001 From: ViktarStarastsenka <99594890+ViktarStarastsenka@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:29:31 +0200 Subject: [PATCH 1/7] Update intro.md --- src/sq/intro.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sq/intro.md b/src/sq/intro.md index 56e44a5..8320794 100644 --- a/src/sq/intro.md +++ b/src/sq/intro.md @@ -1,4 +1,4 @@ -Redis Stack offers an enhanced Redis experience via the following search and query features: +Redis Stack offers an enhanced Redis experience via the following Query Engine features: - A rich query language - Incremental indexing on JSON and hash documents @@ -7,7 +7,7 @@ Redis Stack offers an enhanced Redis experience via the following search and que - Geospatial queries - Aggregations -The search and query features of Redis Stack allow you to use Redis as a: +The Query Engine features of Redis Stack allow you to use Redis as a: - Document database - Vector database @@ -18,6 +18,6 @@ The search and query features of Redis Stack allow you to use Redis as a: [Redis Stack](https://redis.io/download?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials) >=7.2.0-v7 \ OR \ -[RediSearch](https://github.com/RediSearch/RediSearch/) >=2.8.11 \ +[Query Engine](https://github.com/RediSearch/RediSearch/) >=2.8.11 \ OR \ A free Redis Stack instance on [Redis Cloud](https://redis.com/try-free/?utm_source=redis\&utm_medium=app\&utm_campaign=redisinsight_vecsim_guide "Redis Cloud"). From 0d27fe270858cf32da969a0b7e52c685dca56c08 Mon Sep 17 00:00:00 2001 From: ViktarStarastsenka <99594890+ViktarStarastsenka@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:31:56 +0200 Subject: [PATCH 2/7] Update learn-more.md --- src/sq/learn-more.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sq/learn-more.md b/src/sq/learn-more.md index cb37dff..dbb1333 100644 --- a/src/sq/learn-more.md +++ b/src/sq/learn-more.md @@ -1,12 +1,12 @@ ### Documentation -* [Search and query home](https://redis.io/docs/interact/search-and-query/?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials) +* [Query Engine home](https://redis.io/docs/interact/search-and-query/?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials) ### Social -* [Search and query on GitHub](https://github.com/RediSearch/RediSearch) -* [Search and query on Discord](https://discord.com/channels/697882427875393627/1187464938218856501) -* [Search and query on Stack Overflow](https://stackoverflow.com/questions/tagged/redisearch) +* [Query Engine on GitHub](https://github.com/RediSearch/RediSearch) +* [Query Engine on Discord](https://discord.com/channels/697882427875393627/1187464938218856501) +* [Query Engine on Stack Overflow](https://stackoverflow.com/questions/tagged/redisearch) ### Blogs From 2afa2de4df7f43c6864b458c9b5319f1a41f254d Mon Sep 17 00:00:00 2001 From: ViktarStarastsenka <99594890+ViktarStarastsenka@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:39:53 +0200 Subject: [PATCH 3/7] Update learn-more.md --- src/sq/learn-more.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sq/learn-more.md b/src/sq/learn-more.md index dbb1333..a0cd862 100644 --- a/src/sq/learn-more.md +++ b/src/sq/learn-more.md @@ -1,6 +1,7 @@ ### Documentation * [Query Engine home](https://redis.io/docs/interact/search-and-query/?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials) +* [Best practices for scalable Redis Query Engine](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/search/scalable-query-best-practices/?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials) ### Social From 005b56ffdcdc113290fe23fa153ebb91bf56d1dd Mon Sep 17 00:00:00 2001 From: ViktarStarastsenka <99594890+ViktarStarastsenka@users.noreply.github.com> Date: Tue, 1 Oct 2024 15:47:38 +0200 Subject: [PATCH 4/7] Update exact-match.md --- src/sq/exact-match.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/sq/exact-match.md b/src/sq/exact-match.md index 2d794f8..978cf6c 100644 --- a/src/sq/exact-match.md +++ b/src/sq/exact-match.md @@ -19,8 +19,10 @@ FT.CREATE idx:bicycle // idx:bicycle name $.model AS model TEXT WEIGHT 1.0 // idx:bicycle $.model (model) as text $.description AS description TEXT WEIGHT 1.0 // idx:bicycle $.description (description) as text $.price AS price NUMERIC // idx:bicycle $.price (price) as numeric - $.condition AS condition TAG SEPARATOR , // idx:bicycle $.condition (condition) as + $.condition AS condition TAG SEPARATOR , INDEXEMPTY INDEXMISSING // idx:bicycle $.condition (condition) as // comma-separated tags + // INDEXMISSING or INDEXEMPTY is used to search for documents + // with empty or missing properties ``` ```redis:[run_confirmation=true] Load the JSON data @@ -32,8 +34,8 @@ JSON.SET "bicycle:4" "." "{\"brand\": \"Noka Bikes\", \"model\": \"Kahuna\", \"p JSON.SET "bicycle:5" "." "{\"brand\": \"Breakout\", \"model\": \"XBN 2.1 Alloy\", \"price\": 810, \"description\": \"The XBN 2.1 Alloy is our entry-level road bike \\u2013 but that\\u2019s not to say that it\\u2019s a basic machine. With an internal weld aluminium frame, a full carbon fork, and the slick-shifting Claris gears from Shimano\\u2019s, this is a bike which doesn\\u2019t break the bank and delivers craved performance.\", \"condition\": \"new\"}" JSON.SET "bicycle:6" "." "{\"brand\": \"ScramBikes\", \"model\": \"WattBike\", \"price\": 2300, \"description\": \"The WattBike is the best e-bike for people who still feel young at heart. It has a Bafang 1000W mid-drive system and a 48V 17.5AH Samsung Lithium-Ion battery, allowing you to ride for more than 60 miles on one charge. It\\u2019s great for tackling hilly terrain or if you just fancy a more leisurely ride. With three working modes, you can choose between E-bike, assisted bicycle, and normal bike modes.\", \"condition\": \"new\"}" JSON.SET "bicycle:7" "." "{\"brand\": \"Peaknetic\", \"model\": \"Secto\", \"price\": 430, \"description\": \"If you struggle with stiff fingers or a kinked neck or back after a few minutes on the road, this lightweight, aluminum bike alleviates those issues and allows you to enjoy the ride. From the ergonomic grips to the lumbar-supporting seat position, the Roll Low-Entry offers incredible comfort. The rear-inclined seat tube facilitates stability by allowing you to put a foot on the ground to balance at a stop, and the low step-over frame makes it accessible for all ability and mobility levels. The saddle is very soft, with a wide back to support your hip joints and a cutout in the center to redistribute that pressure. Rim brakes deliver satisfactory braking control, and the wide tires provide a smooth, stable ride on paved roads and gravel. Rack and fender mounts facilitate setting up the Roll Low-Entry as your preferred commuter, and the BMX-like handlebar offers space for mounting a flashlight, bell, or phone holder.\", \"condition\": \"new\"}" -JSON.SET "bicycle:8" "." "{\"brand\": \"nHill\", \"model\": \"Summit\", \"price\": 1200, \"description\": \"This budget mountain bike from nHill performs well both on bike paths and on the trail. The fork with 100mm of travel absorbs rough terrain. Fat Kenda Booster tires give you grip in corners and on wet trails. The Shimano Tourney drivetrain offered enough gears for finding a comfortable pace to ride uphill, and the Tektro hydraulic disc brakes break smoothly. Whether you want an affordable bike that you can take to work, but also take trail in mountains on the weekends or you\\u2019re just after a stable, comfortable ride for the bike path, the Summit gives a good value for money.\", \"condition\": \"new\"}" -JSON.SET "bicycle:9" "." "{\"model\": \"ThrillCycle\", \"brand\": \"BikeShind\", \"price\": 815, \"description\": \"An artsy, retro-inspired bicycle that\\u2019s as functional as it is pretty: The ThrillCycle steel frame offers a smooth ride. A 9-speed drivetrain has enough gears for coasting in the city, but we wouldn\\u2019t suggest taking it to the mountains. Fenders protect you from mud, and a rear basket lets you transport groceries, flowers and books. The ThrillCycle comes with a limited lifetime warranty, so this little guy will last you long past graduation.\", \"condition\": \"refurbished\"}" +JSON.SET "bicycle:8" "." "{\"brand\": \"nHill\", \"model\": \"Summit\", \"price\": 1200, \"description\": \"This budget mountain bike from nHill performs well both on bike paths and on the trail. The fork with 100mm of travel absorbs rough terrain. Fat Kenda Booster tires give you grip in corners and on wet trails. The Shimano Tourney drivetrain offered enough gears for finding a comfortable pace to ride uphill, and the Tektro hydraulic disc brakes break smoothly. Whether you want an affordable bike that you can take to work, but also take trail in mountains on the weekends or you\\u2019re just after a stable, comfortable ride for the bike path, the Summit gives a good value for money.\", \"condition\": \"\"}" +JSON.SET "bicycle:9" "." "{\"model\": \"ThrillCycle\", \"brand\": \"BikeShind\", \"price\": 815, \"description\": \"An artsy, retro-inspired bicycle that\\u2019s as functional as it is pretty: The ThrillCycle steel frame offers a smooth ride. A 9-speed drivetrain has enough gears for coasting in the city, but we wouldn\\u2019t suggest taking it to the mountains. Fenders protect you from mud, and a rear basket lets you transport groceries, flowers and books. The ThrillCycle comes with a limited lifetime warranty, so this little guy will last you long past graduation.\"}" ``` ## Numeric fields @@ -100,3 +102,18 @@ Here is an example for finding all bicycles that have a description containing t ```redis Exact phrase match query FT.SEARCH idx:bicycle "@description:\"rough terrain\"" ``` + +## Search for missing or empty properties + +You can search for properties that do not exist in a given document or existing properties with no value. + +```redis Search for empty properties +FT.SEARCH idx:bicycle '@condition:{""}' DIALECT 2 // DIALECT 2 is required +``` + +```redis Search for missing properties +FT.SEARCH idx:bicycle 'ismissing(@condition)' DIALECT 2 // use `ismissing` query function and + // DIALECT 2 +``` + + From 6cca71aa87c34f050b84f942b375921022d314b1 Mon Sep 17 00:00:00 2001 From: ViktarStarastsenka <99594890+ViktarStarastsenka@users.noreply.github.com> Date: Tue, 1 Oct 2024 15:49:10 +0200 Subject: [PATCH 5/7] Update intro.md --- src/sq/intro.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sq/intro.md b/src/sq/intro.md index 8320794..c84feaf 100644 --- a/src/sq/intro.md +++ b/src/sq/intro.md @@ -16,8 +16,8 @@ The Query Engine features of Redis Stack allow you to use Redis as a: ### Prerequisites -[Redis Stack](https://redis.io/download?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials) >=7.2.0-v7 \ +[Redis Stack](https://redis.io/download?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials) >=7.4.0-v0 \ OR \ -[Query Engine](https://github.com/RediSearch/RediSearch/) >=2.8.11 \ +[Query Engine](https://github.com/RediSearch/RediSearch/) >=2.10.5 \ OR \ A free Redis Stack instance on [Redis Cloud](https://redis.com/try-free/?utm_source=redis\&utm_medium=app\&utm_campaign=redisinsight_vecsim_guide "Redis Cloud"). From 77885f75641ae5278ddd6281a04b6cfe66100f17 Mon Sep 17 00:00:00 2001 From: ViktarStarastsenka <99594890+ViktarStarastsenka@users.noreply.github.com> Date: Tue, 1 Oct 2024 16:31:29 +0200 Subject: [PATCH 6/7] Update intro.md --- src/sq/intro.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sq/intro.md b/src/sq/intro.md index c84feaf..a3c9215 100644 --- a/src/sq/intro.md +++ b/src/sq/intro.md @@ -1,4 +1,4 @@ -Redis Stack offers an enhanced Redis experience via the following Query Engine features: +Redis Stack offers an enhanced Redis experience via the following Redis Query Engine features: - A rich query language - Incremental indexing on JSON and hash documents @@ -7,7 +7,7 @@ Redis Stack offers an enhanced Redis experience via the following Query Engine f - Geospatial queries - Aggregations -The Query Engine features of Redis Stack allow you to use Redis as a: +The Redis Query Engine features of Redis Stack allow you to use Redis as a: - Document database - Vector database @@ -18,6 +18,6 @@ The Query Engine features of Redis Stack allow you to use Redis as a: [Redis Stack](https://redis.io/download?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials) >=7.4.0-v0 \ OR \ -[Query Engine](https://github.com/RediSearch/RediSearch/) >=2.10.5 \ +[Redis Query Engine](https://github.com/RediSearch/RediSearch/) >=2.10.5 \ OR \ A free Redis Stack instance on [Redis Cloud](https://redis.com/try-free/?utm_source=redis\&utm_medium=app\&utm_campaign=redisinsight_vecsim_guide "Redis Cloud"). From ffb79ac4ba50d1041d589d93e62be47e742725ae Mon Sep 17 00:00:00 2001 From: ViktarStarastsenka <99594890+ViktarStarastsenka@users.noreply.github.com> Date: Tue, 1 Oct 2024 16:32:42 +0200 Subject: [PATCH 7/7] Update learn-more.md --- src/sq/learn-more.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sq/learn-more.md b/src/sq/learn-more.md index a0cd862..9fde870 100644 --- a/src/sq/learn-more.md +++ b/src/sq/learn-more.md @@ -1,13 +1,13 @@ ### Documentation -* [Query Engine home](https://redis.io/docs/interact/search-and-query/?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials) +* [Redis Query Engine home](https://redis.io/docs/interact/search-and-query/?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials) * [Best practices for scalable Redis Query Engine](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/search/scalable-query-best-practices/?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials) ### Social -* [Query Engine on GitHub](https://github.com/RediSearch/RediSearch) -* [Query Engine on Discord](https://discord.com/channels/697882427875393627/1187464938218856501) -* [Query Engine on Stack Overflow](https://stackoverflow.com/questions/tagged/redisearch) +* [Redis Query Engine on GitHub](https://github.com/RediSearch/RediSearch) +* [Redis Query Engine on Discord](https://discord.com/channels/697882427875393627/1187464938218856501) +* [Redis Query Engine on Stack Overflow](https://stackoverflow.com/questions/tagged/redisearch) ### Blogs