Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 745 Bytes

create-an-index-in-redisearch.md

File metadata and controls

28 lines (20 loc) · 745 Bytes

Create An Index In RediSearch

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%"