Category: Redis
RediSearch is an enterprise search extension for Redis and ships with the Redis Server stack. It provides support for querying, secondary indexing, and full-text search including wildcard and fuzzy search.
Assuming a dictionary structure of the following:
mapping={
"manufacturer": manufacturer,
"model": model,
"weight": weight,
"description": description,
}
Create an index for searching against the description
field:
FT.CREATE inventory-description-idx PREFIX 1 inventory: SCHEMA description TEXT
To search for the word "touring" using wildcards against the description field:
FT.SEARCH inventory-description-idx "%touring%"