Quickstart: Searching and Querying Redis data

Learn how to search and query your Redis data

Make sure that you have Redis Stack installed and running. Alternatively, you can create a free Redis Cloud account.

Connect to Redis Stack

Create an Index

Use the FT.CREATE command to create an index with fields and weights (default weight is 1.0):

Any existing JSON documents that have a key prefixed with bicycle: are automatically added to the index at this time.

Add Documents

After you create the index, any new JSON documents with the bicycle: prefix are automatically indexed upon creation.

Use the JSON.SET command to create a new JSON document and add it to the index:

Search the Index

Wildcard Query

Let's retrieve all indexed documents using the FT.SEARCH command.

Query with a single term

To perform simple single term query and find all bicycles with specific model we can use the following query:

Exact match query

To perform an exact match query, use double quotes around the search term. For example, to find all bicycles with the brand Noka Bikes:

To learn how to make more advanced queries, see the Querying syntax.

Rate this page