{
  "schema_version": 2,
  "id": "develop/ai/search-and-query/query",
  "title": "Querying data",
  "url": "https://redis.io/docs/latest/develop/ai/search-and-query/query/",
  "summary": "Understand how to query, search, and aggregate Redis data",
  "aliases": [
    "/develop/interact/search-and-query/query",
    "/develop/interact/search-and-query/query/",
    "/interact/search-and-query/query/"
  ],
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-11T15:33:04+01:00",
  "children": [
    {
      "id": "develop/ai/search-and-query/query/exact-match",
      "summary": "Perform simple exact match queries",
      "title": "Exact match queries",
      "url": "https://redis.io/docs/latest/develop/ai/search-and-query/query/exact-match/"
    },
    {
      "id": "develop/ai/search-and-query/query/range",
      "summary": "Perform numeric range queries",
      "title": "Range queries",
      "url": "https://redis.io/docs/latest/develop/ai/search-and-query/query/range/"
    },
    {
      "id": "develop/ai/search-and-query/query/full-text",
      "summary": "Perform a full-text search",
      "title": "Full-text search",
      "url": "https://redis.io/docs/latest/develop/ai/search-and-query/query/full-text/"
    },
    {
      "id": "develop/ai/search-and-query/query/geo-spatial",
      "summary": "Query based on geographic data",
      "title": "Geospatial queries",
      "url": "https://redis.io/docs/latest/develop/ai/search-and-query/query/geo-spatial/"
    },
    {
      "id": "develop/ai/search-and-query/query/vector-search",
      "summary": "Query for data based on vector embeddings",
      "title": "Vector search",
      "url": "https://redis.io/docs/latest/develop/ai/search-and-query/query/vector-search/"
    },
    {
      "id": "develop/ai/search-and-query/query/combined",
      "summary": "Combine query expressions",
      "title": "Combined queries",
      "url": "https://redis.io/docs/latest/develop/ai/search-and-query/query/combined/"
    },
    {
      "id": "develop/ai/search-and-query/query/aggregation",
      "summary": "Group and aggregate query results",
      "title": "Aggregation queries",
      "url": "https://redis.io/docs/latest/develop/ai/search-and-query/query/aggregation/"
    },
    {
      "id": "develop/ai/search-and-query/query/interactive-demo",
      "summary": "Run full-text, filter, and aggregation queries on a food delivery app's restaurants and orders, and see each redis-cli command and reply.",
      "title": "Query interactive demo",
      "url": "https://redis.io/docs/latest/develop/ai/search-and-query/query/interactive-demo/"
    }
  ],
  "page_type": "content",
  "content_hash": "55e25db721fecba0f34dca6b3e6c6951f4ba6fde8f34fe5f113b36b9e264ed5c",
  "sections": [
    {
      "id": "content",
      "title": "Content",
      "role": "content",
      "text": "Redis Open Source distinguishes between the [FT.SEARCH](https://redis.io/docs/latest/commands/ft.search) and [FT.AGGREGATE](https://redis.io/docs/latest/commands/ft.aggregate) query commands. You should use [FT.SEARCH](https://redis.io/docs/latest/commands/ft.search) if you want to perform selections and projections only. If you also need to apply mapping functions, group, or aggregate data, use the [FT.AGGREGATE](https://redis.io/docs/latest/commands/ft.aggregate) command. \n\n* **Selection**: A selection allows you to return all documents that fulfill specific criteria.\n* **Projection**: Projections are used to return specific fields of the result set. You can also map/project to calculated field values.\n* **Aggregation**: Aggregations collect and summarize data across several fields.\n\nHere is a short SQL comparison using the [bicycle dataset](./data/bicycles.txt):\n\n|Type| SQL | Redis |\n|----------| --- | ----------- |\n| Selection | `SELECT * FROM bicycles WHERE price >= 1000` | `FT.SEARCH idx:bicycle \"@price:[1000 +inf]\"` |\n| Simple projection | `SELECT id, price FROM bicycles` | `FT.SEARCH idx:bicycle \"*\" RETURN 2 __key, price` |\n| Calculated projection| `SELECT id, price-price*0.1 AS discounted FROM bicycles`| `FT.AGGREGATE idx:bicycle \"*\" LOAD 2 __key price APPLY \"@price-@price*0.1\" AS discounted`| \n| Aggregation | `SELECT condition, AVG(price) AS avg_price FROM bicycles GROUP BY condition` | `FT.AGGREGATE idx:bicycle \"*\" GROUPBY 1 @condition REDUCE AVG 1 @price AS avg_price` |\n\nThe following articles provide an overview of how to query data with the [FT.SEARCH](https://redis.io/docs/latest/commands/ft.search) command:\n\n* [Exact match queries](https://redis.io/docs/latest/develop/ai/search-and-query/query/exact-match)\n* [Range queries](https://redis.io/docs/latest/develop/ai/search-and-query/query/range)\n* [Full-text search ](https://redis.io/docs/latest/develop/ai/search-and-query/query/full-text)\n* [Geospatial queries](https://redis.io/docs/latest/develop/ai/search-and-query/query/geo-spatial)\n* [Vector search](https://redis.io/docs/latest/develop/ai/search-and-query/query/vector-search)\n* [Combined queries](https://redis.io/docs/latest/develop/ai/search-and-query/query/combined)\n\nYou can find further details about aggregation queries with [FT.AGGREGATE](https://redis.io/docs/latest/commands/ft.aggregate) in the following article:\n\n* [Aggregation queries](https://redis.io/docs/latest/develop/ai/search-and-query/query/aggregation)"
    }
  ],
  "examples": []
}
