{"id":22547797,"url":"https://github.com/redis/NRedisStack","last_synced_at":"2025-08-04T08:33:29.103Z","repository":{"id":47328270,"uuid":"515208425","full_name":"redis/NRedisStack","owner":"redis","description":"Redis Stack .Net client","archived":false,"fork":false,"pushed_at":"2024-11-29T15:28:15.000Z","size":4712,"stargazers_count":246,"open_issues_count":20,"forks_count":39,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-12-04T10:40:25.049Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-18T14:01:57.000Z","updated_at":"2024-11-29T14:36:00.000Z","dependencies_parsed_at":"2023-09-26T16:55:34.762Z","dependency_job_id":"9113721d-261e-410f-804b-6fb3e71b549e","html_url":"https://github.com/redis/NRedisStack","commit_stats":{"total_commits":214,"total_committers":22,"mean_commits":9.727272727272727,"dds":0.5280373831775701,"last_synced_commit":"73e7a6daefed30a2e958f692a5c44dd7d73f7f22"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis%2FNRedisStack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis%2FNRedisStack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis%2FNRedisStack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis%2FNRedisStack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redis","download_url":"https://codeload.github.com/redis/NRedisStack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228341234,"owners_count":17904848,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-07T15:12:55.618Z","updated_at":"2025-08-04T08:33:29.091Z","avatar_url":"https://github.com/redis.png","language":"C#","funding_links":[],"categories":["Vector Store SDKs"],"sub_categories":["Teams"],"readme":"[![license](https://img.shields.io/github/license/redis/NRedisStack.svg)](https://raw.githubusercontent.com/redis/NRedisStack/master/LICENSE)\n[![.github/workflows/integration.yml](https://github.com/redis/NRedisStack/actions/workflows/integration.yml/badge.svg)](https://github.com/redis/NRedisStack/actions/workflows/integration.yml)\n[![codecov](https://codecov.io/gh/redis/NRedisStack/branch/master/graph/badge.svg?token=4B0KCNK12D)](https://codecov.io/gh/redis/NRedisStack)\n[![NRedisStack NuGet release](https://img.shields.io/nuget/v/NRedisStack.svg?label=nuget\u0026logo=nuget)](https://www.nuget.org/packages/NRedisStack)\n\n\n# NRedisStack\n\n.NET Client for Redis\n\n## Note\n\nThis project builds on [StackExchange.Redis](https://github.com/StackExchange/StackExchange.Redis), and seeks to bring native support for Redis Stack commands to the C# ecosystem.\n\n## How do I Redis?\n\n[Learn for free at Redis University](https://university.redis.com/)\n\n[Build faster with the Redis Launchpad](https://launchpad.redis.com/)\n\n[Try the Redis Cloud](https://redis.com/try-free/)\n\n[Dive in developer tutorials](https://developer.redis.com/)\n\n[Join the Redis community](https://redis.com/community/)\n\n[Work at Redis](https://redis.com/company/careers/jobs/)\n\n## API\n\nThe complete documentation for Redis  module commands can be found at the [Redis commands website](https://redis.io/commands/).\n\n### Redis OSS commands\n\nYou can use Redis OSS commands in the same way as you use them in [StackExchange.Redis](https://github.com/StackExchange/StackExchange.Redis).\n\n### Stack commands\n\nEach module has a command class with its own commands.\n\nThe supported modules are [Search](https://redis.io/commands/?group=search), [JSON](https://redis.io/commands/?group=json), [TimeSeries](https://redis.io/commands/?group=timeseries), [Bloom Filter](https://redis.io/commands/?group=bf), [Cuckoo Filter](https://redis.io/commands/?group=cf), [T-Digest](https://redis.io/commands/?group=tdigest), [Count-min Sketch](https://redis.io/commands/?group=cms), and [Top-K](https://redis.io/commands/?group=topk).\n\n**Note:** RedisGraph support has been deprecated starting from Redis Stack version 7.2. For more information, please refer to [this blog post](https://redis.com/blog/redisgraph-eol/).\u003cbr\u003e\n**IMPORTANT:** NRedisStack will end the support for Graph functionalities with version 0.13.x\u003cbr\u003e\n**IMPORTANT:** Starting from version **1.0.0-beta1**, by default, the client now overrides the [server-side dialect](https://redis.io/docs/latest/develop/interact/search-and-query/advanced-concepts/dialects/) with version 2, automatically appending `DIALECT 2` to commands like **FT.AGGREGATE** and **FT.SEARCH**. Be aware that the query dialect may impact the results returned. If needed, you can revert to a different dialect version by configuring the client accordingly. Please see [release notes](https://github.com/redis/NRedisStack/releases/tag/v1.0.0-beta1).\n\n# Usage\n\n## 💻 Installation\n\nUsing the dotnet cli, run:\n\n```text\ndotnet add package NRedisStack\n```\n\n## 🏁 Getting started\n\n### Supported Redis versions\n\nThe most recent version of this library supports Redis version [6.2](https://github.com/redis/redis/blob/6.2/00-RELEASENOTES), [7.2](https://github.com/redis/redis/blob/7.2/00-RELEASENOTES).\n\n### Starting Redis\n\nBefore writing any code, you'll need a Redis instance with the appropriate Redis modules. The quickest way to get this is with Docker:\n\n```sh\ndocker run -p 6379:6379 --name redis-stack redis/redis-stack:latest\n```\n\nThis launches [Redis Stack](https://redis.io/docs/stack/), an extension of Redis that adds modern data structures to Redis.\n\nNow, you need to connect to Redis, exactly the same way you do it in [StackExchange.Redis](https://github.com/StackExchange/StackExchange.Redis):\n```csharp\nusing NRedisStack;\nusing NRedisStack.RedisStackCommands;\nusing StackExchange.Redis;\n//...\nConnectionMultiplexer redis = ConnectionMultiplexer.Connect(\"localhost\");\nIDatabase db = redis.GetDatabase();\n```\nNow you can create a variable from any type of module in the following way:\n```csharp\nBloomCommands bf = db.BF();\nCuckooCommands cf = db.CF();\nCmsCommands cms = db.CMS();\nTopKCommands topk = db.TOPK();\nTdigestCommands tdigest = db.TDIGEST();\nSearchCommands ft = db.FT();\nJsonCommands json = db.JSON();\nTimeSeriesCommands ts = db.TS();\nGraphCommands graph = db.GRAPH(); // If Redis version is less than 7.2 and NRedisStack version is less than 0.13.x\n```\nThen, that variable will allow you to call all the commands of that module.\n\n## Examples\n\n### Store a JSON object in Redis\n\nTo store a json object in Redis:\n\n```csharp\nConnectionMultiplexer redis = ConnectionMultiplexer.Connect(\"localhost\");\nIDatabase db = redis.GetDatabase();\n\nJsonCommands json = db.JSON();\nvar key = \"myKey\";\njson.Set(key, \"$\", new { Age = 35, Name = \"Alice\" });\n```\n\n### Index and search\nNow, to execute a search  for objects, we need to index them on the server, and run a query:\n\nSetup:\n\n```csharp\nusing NRedisStack.Search;\nusing NRedisStack.Search.Literals.Enums;\n//...\nConnectionMultiplexer redis = ConnectionMultiplexer.Connect(\"localhost\");\nIDatabase db = redis.GetDatabase();\n\nSearchCommands ft = db.FT();\nJsonCommands json = db.JSON();\n```\n\nCreate an index with fields and weights:\n```csharp\n// FT.CREATE myIdx ON HASH PREFIX 1 doc: SCHEMA title TEXT WEIGHT 5.0 body TEXT url TEXT\nft.Create(\"myIndex\", new FTCreateParams().On(IndexDataType.HASH)\n                                         .Prefix(\"doc:\"),\n                     new Schema().AddTextField(\"title\", 5.0)\n                                 .AddTextField(\"body\")\n                                 .AddTextField(\"url\"));\n```\n\nAfter creating the index, future documents with the ```doc:``` prefix will be automatically indexed when created or modified.\n\nTo create a new hash document and add it to the index, use the HSET command:\n```csharp\n// HSET doc:1 title \"hello world\" body \"lorem ipsum\" url \"http://redis.io\"\ndb.HashSet(\"doc:1\", new HashEntry[] { new(\"title\", \"hello world\"),\n                                      new(\"body\", \"lorem ipsum\"),\n                                      new(\"url\", \"http://redis.io\") });\n```\nSearch the index for documents that contain \"hello world\":\n```csharp\n// FT.SEARCH myIndex \"hello world\" LIMIT 0 10\nft.Search(\"myIndex\", new Query(\"hello world\").Limit(0, 10));\n```\nDrop the index:\n```csharp\n// FT.DROPINDEX myIndex\nft.DropIndex(\"myIndex\");\n```\n\nMore examples can be found in the [examples folder](Examples).\n\n## For Contributors\nTo contribute NRedisStack, please see :point_right: [Contribution notes](CONTRIBUTING.md)\n\n------\n\n# Author\n\nNRedisStack is developed and maintained by [Redis Inc](https://redis.com). It can be found [here](\nhttps://github.com/redis/NRedisStack), or downloaded from [NuGet](https://www.nuget.org/packages/NRedisStack).\n\n---\n\n[![Redis](./docs/logo-redis.png)](https://www.redis.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredis%2FNRedisStack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredis%2FNRedisStack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredis%2FNRedisStack/lists"}