Query interactive demo
Run full-text, filter, and aggregation queries on a food delivery app's restaurants and orders, and see each redis-cli command and reply.
Redis Search lets you query data through an index you create. This demo uses restaurant and order data from a food delivery app, stored as hashes. It starts by showing the data and a possible index. Next, three kinds of queries are demonstrated: full-text search, filter and sort, and aggregation. For each query, it shows the command, the matching data, and the exact reply.
The demo runs in your browser and doesn't connect to Redis. Its commands and replies were recorded from Redis, and each command works as shown in redis-cli once you create the indexes and add the data. The restaurants and orders are the same sample data as the Context Retriever interactive demo.
What the demo shows
- The data. Each restaurant is a hash. An index, created with
FT.CREATE, tells Redis Search which fields to search and how. See Indexing. - Full-text search.
FT.SEARCHfinds words inTEXTfields, including other forms of each word, such as plurals. It also handles exact phrases, prefixes, fuzzy matches, and the|,-, and@field:operators.HIGHLIGHTmarks the words that matched. See Full-text search. - Filter and sort.
TAGandNUMERICfields take exact conditions, and conditions side by side must all match.SORTBYorders the matches. See Exact match queries and Range queries. - Aggregate.
FT.AGGREGATEgroups the matching orders withGROUPBYand reduces each group withREDUCE, here withCOUNT,SUM, andAVG. See Aggregation queries.