Skip to content

Commit

Permalink
Merge pull request #70 from RedisInsight/ViktarStarastsenka-patch-1
Browse files Browse the repository at this point in the history
Updating the Redis Query Engine name and including information to index missing or empty values
  • Loading branch information
ViktarStarastsenka authored Oct 1, 2024
2 parents 2824abf + ffb79ac commit d6d18bf
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.
23 changes: 20 additions & 3 deletions src/sq/exact-match.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
```


8 changes: 4 additions & 4 deletions src/sq/intro.md
Original file line number Diff line number Diff line change
@@ -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 Redis Query Engine features:

- A rich query language
- Incremental indexing on JSON and hash documents
Expand All @@ -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 Redis Query Engine features of Redis Stack allow you to use Redis as a:

- Document database
- Vector database
Expand All @@ -16,8 +16,8 @@ The search and query 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 \
[RediSearch](https://github.com/RediSearch/RediSearch/) >=2.8.11 \
[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").
9 changes: 5 additions & 4 deletions src/sq/learn-more.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
### Documentation

* [Search and query 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

* [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)
* [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

Expand Down

0 comments on commit d6d18bf

Please sign in to comment.