The RediSearch 2.x module is a source-available project that lets you build powerful search queries for open source Redis databases. When combined with Redis Enterprise Software, you can use the same RediSearch protocols and commands to run geo-replicated queries and full-text searches over efficient in-memory indexes.
The RediSearch engine indexes documents, which are objects that represent data as field-value pairs. You can index more than one field per document, and these fields can represent text, numeric, or geospatial data types.
As the documents in your database change, the index automatically processes these changes to keep the search results up to date.
With RediSearch indexes, you can do:
- Language-aware fuzzy matching
- Fast auto-complete
- Exact phrase matching
- Numeric filtering
- Geo-radius queries
Supported document types
You can store documents as Redis hashes or JSON. To use JSON documents with RediSearch, you also need to enable the RedisJSON module in your database.
With Redis hashes, each document is assigned to a single key and uses field-value pairs to represent the document’s contents.
You can run
HGETALL to retrieve the entire hash document.
If a database has RedisJSON enabled, you can store documents as JSON and use RediSearch to index and search for them.
For more information about how to use RediSearch with JSON documents, see the Search JSON quick start.
For full-text searches, you can customize the field queries and ranking of the search results. When querying, you can use multiple predicates that query text, numeric, and geospatial fields in one query. You can also sort by a specific field and limit the results with an offset to produce customized results pages.
RediSearch supports over 15 natural languages for stemming and includes auto-complete engines with specific commands that can provide real-time interactive search suggestions.
RediSearch in Active-Active databases
As a result of the new RediSearch architecture and methodology, RediSearch 2.x supports Active-Active databases. You can now serve your index information from geo-distributed database instances.
Resharding and RediSearch
By moving the index out of the keyspace and structuring the data as hashes, RediSearch 2.x makes it possible to reshard the database. When half of the data moves to the new shard, the index related to that data is created synchronously and RediSearch removes the keys from the index when it detects that the keys were deleted. Because the index on the new shard is created synchronously though, it’s expected that the resharding process will take longer than resharding of a database without RediSearch.
- You cannot use RediSearch with the OSS Cluster API.