{
  "schema_version": 2,
  "id": "develop/ai/search-and-query/indexing/interactive-demo",
  "title": "Indexing interactive demo",
  "url": "https://redis.io/docs/latest/develop/ai/search-and-query/indexing/interactive-demo/",
  "summary": "Change an index's field types, prefixes, and options, and see what each query finds, with every redis-cli command and reply.",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-10-15T10:36:51+02:00",
  "page_type": "content",
  "content_hash": "4a847410817586af16b75756a939a0a16cc737aeb974cc41227e2cff6de050da",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Redis Search only finds data that's in an index. You create an index with `FT.CREATE`, which says which keys to include and how to treat each of their fields, and Redis keeps it up to date as the data changes. How you define the index decides what queries can find.\n\nThis demo starts with the data itself, the restaurants of a food delivery app, then creates an index on it and lets you change it: the field types, the keys it covers, how it handles missing and invalid values, and whether the restaurants are hashes or JSON documents. For each change, it shows the commands, the stored data, and which restaurants the query finds.\n\nThe demo runs in your browser and doesn't connect to Redis. Its commands and replies were recorded from Redis, each starting from an empty database, and they work as shown in `redis-cli`."
    },
    {
      "id": "what-the-demo-shows",
      "title": "What the demo shows",
      "role": "content",
      "text": "1. **The data.** Each restaurant is a hash: a key whose name starts with `restaurant:`, holding named fields. Every value in a hash is a string, and Redis finds a hash by its key, not by its contents, until you index it.\n2. **Field types.** `TEXT` fields match words, including other forms of each word, such as plurals. `TAG` fields match whole values. `NUMERIC` fields match ranges. A query that doesn't fit the field's type finds nothing, and with `DIALECT 2` it returns an error instead. See [Field and type options](https://redis.io/docs/latest/develop/ai/search-and-query/indexing/field-and-type-options).\n3. **Which keys.** `PREFIX` decides which keys an index covers, and `FILTER` narrows them down by value. Redis indexes each later write as it happens. See [`FT.CREATE`](https://redis.io/docs/latest/commands/ft.create).\n4. **Missing and bad values.** A value that doesn't fit its field's type keeps Redis from indexing the whole hash, and [`FT.INFO`](https://redis.io/docs/latest/commands/ft.info) counts the failure. `INDEXMISSING` and `INDEXEMPTY` let you query for missing and empty values. See [Index missing or empty values](https://redis.io/docs/latest/develop/ai/search-and-query/indexing#index-missing-or-empty-values).\n5. **Hash or JSON.** An index on JSON documents names JSON paths and gives each one a name with `AS`. Queries are the same as for hashes, but a JSON index returns whole documents as JSON, and Redis 8 doesn't support `HIGHLIGHT` on it. See [Indexing](https://redis.io/docs/latest/develop/ai/search-and-query/indexing)."
    }
  ],
  "examples": []
}
