Loading...
Loading...
Redis Query Engine (RQE) guidance covering FT.CREATE schema design, field type selection (TEXT, TAG, NUMERIC, GEO, GEOSHAPE, VECTOR), DIALECT 2 query syntax, efficient FT.SEARCH and FT.AGGREGATE queries, zero-downtime index updates via aliases, and the SKIPINITIALSCAN option. Use when defining a search index on Hash or JSON documents, picking between TEXT and TAG for filtering, writing FT.SEARCH queries with filters and SORTBY, managing or swapping indexes in production, or troubleshooting slow searches with FT.PROFILE.
npx skill4agent add redis/agent-skills redis-query-engineFT.CREATEFT.CREATEFT.ALTERFT.SEARCHFT.AGGREGATETEXTTAGNUMERICGEOGEOSHAPEVECTORDIALECT 2FT.SEARCH idx:products "@name:laptop" DIALECT 2DIALECT 2| Field type | Use when | Notes |
|---|---|---|
| Full-text search needed | Tokenized + stemmed; not for exact match |
| Exact match / filtering | Add |
| Range queries, sorting | Prices, counts, timestamps |
| Lat/long point queries | Single points (stores, users) |
| Polygon / area queries | Delivery zones, regions |
| Similarity search | HNSW or FLAT; see redis-vector-search |
TEXTTAGFT.CREATEPREFIXFT.CREATE idx:products ON HASH PREFIX 1 product:
SCHEMA
name TEXT WEIGHT 2.0
category TAG SORTABLE
price NUMERIC SORTABLE
location GEOPREFIXFILTERFT.INFO idx:<name>SORTABLEFT.CREATE idx:products_v2 ON HASH PREFIX 1 product: SCHEMA ...
FT.ALIASUPDATE products idx:products_v2
# App queries are stable:
FT.SEARCH products "@category:{electronics}"FT.INFOFT.DROPINDEXFT._LISTFT.ALIASADD/UPDATE/DELFT.CREATESKIPINITIALSCAN*# Good — specific filter, limited fields returned
FT.SEARCH idx:products "@category:{electronics} @price:[100 500]"
LIMIT 0 20
RETURN 3 name price category# Bad — full scan plus unbounded LIMIT
FT.SEARCH idx:products "*" LIMIT 0 10000SORTBYSORTABLELIMITRETURNFT.PROFILE idx:<name> SEARCH QUERY "<query>"