If you're already using ioredis in your project, you can use Redis Search without switching to the @upstash/redis client. The @upstash/search-ioredis package wraps your existing ioredis instance and exposes the full Redis Search API.
Installation#
Setup#
The REDIS_URL should be your Upstash Redis connection string in the format:
Create an Index#
Get an Index Client#
Use search.index() to get a client for an existing index without making a Redis call:
Add Data#
Add data using standard Redis commands via your ioredis client. Any key matching the index prefix is automatically indexed:
Search Data#
Wait for Indexing#
Index updates are batched for performance. Use waitIndexing() when you need queries to reflect recent writes:
Describe an Index#
Drop an Index#
The adapter exposes the exact same search API as @upstash/redis. Refer to the Index Management, Querying, Aggregations, and Schema Definition pages for the full API reference.