Skip to content

Commit 4734135

Browse files
committed
Enrich documentation with complete API reference tables
Each feature doc page now includes a full API Reference table with method signatures, Redis commands, and return types. This ensures AI coding assistants (via llms.txt/Context7) have accurate method signatures, not just tutorial examples. - doc/geospatial.md: 16-method API reference table - doc/streams.md: 16-method API reference table - doc/vectorset.md: 14-method API reference table with Lease<T> notes - doc/compressors.md: full NuGet package names, class names, install commands for all 5 compressor packages
1 parent 4ae1715 commit 4734135

File tree

4 files changed

+80
-7
lines changed

4 files changed

+80
-7
lines changed

doc/compressors.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,24 @@ graph LR
1616

1717
## Available Compressors
1818

19-
| Package | Algorithm | Speed | Ratio | Dependencies |
20-
|---------|----------|-------|-------|-------------|
21-
| `Compression.LZ4` | LZ4 | Fastest | Lower | K4os.Compression.LZ4 |
22-
| `Compression.Snappier` | Snappy | Very Fast | Lower | Snappier |
23-
| `Compression.ZstdSharp` | Zstandard | Fast | Good | ZstdSharp.Port |
24-
| `Compression.GZip` | GZip | Moderate | Good | None (BCL) |
25-
| `Compression.Brotli` | Brotli | Slower | Best | None (BCL) |
19+
| NuGet Package | Class | Algorithm | Speed | Ratio |
20+
|---------------|-------|----------|-------|-------|
21+
| `StackExchange.Redis.Extensions.Compression.LZ4` | `LZ4Compressor` | LZ4 | Fastest | Lower |
22+
| `StackExchange.Redis.Extensions.Compression.Snappier` | `SnappierCompressor` | Snappy | Very Fast | Lower |
23+
| `StackExchange.Redis.Extensions.Compression.ZstdSharp` | `ZstdSharpCompressor` | Zstandard | Fast | Good |
24+
| `StackExchange.Redis.Extensions.Compression.GZip` | `GZipCompressor` | GZip | Moderate | Good |
25+
| `StackExchange.Redis.Extensions.Compression.Brotli` | `BrotliCompressor` | Brotli | Slower | Best |
26+
27+
### Install
28+
29+
```bash
30+
# Pick one:
31+
dotnet add package StackExchange.Redis.Extensions.Compression.LZ4
32+
dotnet add package StackExchange.Redis.Extensions.Compression.Snappier
33+
dotnet add package StackExchange.Redis.Extensions.Compression.ZstdSharp
34+
dotnet add package StackExchange.Redis.Extensions.Compression.GZip
35+
dotnet add package StackExchange.Redis.Extensions.Compression.Brotli
36+
```
2637

2738
### Recommendations
2839

doc/geospatial.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,23 @@ graph LR
9393
```
9494

9595
> **Note:** Geo members are string identifiers (e.g., store names, IDs). Coordinates are stored internally by Redis as sorted set scores. If you need to associate complex objects with a location, store them under a key derived from the member name.
96+
97+
## API Reference
98+
99+
| Method | Redis Command | Parameters | Returns |
100+
|--------|--------------|------------|---------|
101+
| `GeoAddAsync(key, longitude, latitude, member)` | GEOADD | `string key, double lon, double lat, string member` | `Task<bool>` |
102+
| `GeoAddAsync(key, value)` | GEOADD | `string key, GeoEntry value` | `Task<bool>` |
103+
| `GeoAddAsync(key, values)` | GEOADD | `string key, GeoEntry[] values` | `Task<long>` |
104+
| `GeoRemoveAsync(key, member)` | ZREM | `string key, string member` | `Task<bool>` |
105+
| `GeoDistanceAsync(key, member1, member2, unit)` | GEODIST | `string key, string m1, string m2, GeoUnit unit` | `Task<double?>` |
106+
| `GeoHashAsync(key, member)` | GEOHASH | `string key, string member` | `Task<string?>` |
107+
| `GeoHashAsync(key, members)` | GEOHASH | `string key, string[] members` | `Task<string?[]>` |
108+
| `GeoPositionAsync(key, member)` | GEOPOS | `string key, string member` | `Task<GeoPosition?>` |
109+
| `GeoPositionAsync(key, members)` | GEOPOS | `string key, string[] members` | `Task<GeoPosition?[]>` |
110+
| `GeoRadiusAsync(key, member, radius, ...)` | GEORADIUS | by member | `Task<GeoRadiusResult[]>` |
111+
| `GeoRadiusAsync(key, lon, lat, radius, ...)` | GEORADIUS | by coordinates | `Task<GeoRadiusResult[]>` |
112+
| `GeoSearchAsync(key, member, shape, ...)` | GEOSEARCH | by member + shape | `Task<GeoRadiusResult[]>` |
113+
| `GeoSearchAsync(key, lon, lat, shape, ...)` | GEOSEARCH | by coordinates + shape | `Task<GeoRadiusResult[]>` |
114+
| `GeoSearchAndStoreAsync(src, dst, member, shape, ...)` | GEOSEARCHSTORE | by member | `Task<long>` |
115+
| `GeoSearchAndStoreAsync(src, dst, lon, lat, shape, ...)` | GEOSEARCHSTORE | by coordinates | `Task<long>` |

doc/streams.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,24 @@ foreach (var entry in entries)
157157
```
158158

159159
> **Note:** For advanced operations (XCLAIM, XAUTOCLAIM, XINFO), use `redis.Database` to access the underlying StackExchange.Redis `IDatabase` directly.
160+
161+
## API Reference
162+
163+
| Method | Redis Command | Returns |
164+
|--------|--------------|---------|
165+
| `StreamAddAsync<T>(key, fieldName, value, ...)` | XADD | `Task<RedisValue>` (message ID) |
166+
| `StreamAddAsync(key, entries, ...)` | XADD | `Task<RedisValue>` (message ID) |
167+
| `StreamLengthAsync(key)` | XLEN | `Task<long>` |
168+
| `StreamTrimAsync(key, maxLength, ...)` | XTRIM | `Task<long>` (entries removed) |
169+
| `StreamDeleteAsync(key, messageIds)` | XDEL | `Task<long>` (entries deleted) |
170+
| `StreamRangeAsync(key, minId, maxId, count, order)` | XRANGE/XREVRANGE | `Task<StreamEntry[]>` |
171+
| `StreamReadAsync(key, position, count)` | XREAD | `Task<StreamEntry[]>` |
172+
| `StreamCreateConsumerGroupAsync(key, groupName, position, createStream)` | XGROUP CREATE | `Task<bool>` |
173+
| `StreamConsumerGroupSetPositionAsync(key, groupName, position)` | XGROUP SETID | `Task<bool>` |
174+
| `StreamDeleteConsumerGroupAsync(key, groupName)` | XGROUP DESTROY | `Task<bool>` |
175+
| `StreamDeleteConsumerAsync(key, groupName, consumerName)` | XGROUP DELCONSUMER | `Task<long>` |
176+
| `StreamReadGroupAsync(key, groupName, consumerName, position, count, noAck)` | XREADGROUP | `Task<StreamEntry[]>` |
177+
| `StreamAcknowledgeAsync(key, groupName, messageId)` | XACK | `Task<long>` |
178+
| `StreamAcknowledgeAsync(key, groupName, messageIds)` | XACK | `Task<long>` |
179+
| `StreamPendingAsync(key, groupName)` | XPENDING | `Task<StreamPendingInfo>` |
180+
| `StreamPendingMessagesAsync(key, groupName, count, consumerName, ...)` | XPENDING | `Task<StreamPendingMessageInfo[]>` |

doc/vectorset.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,27 @@ using var results = await redis.VectorSetSimilaritySearchAsync("clothing",
134134
VectorSetSimilaritySearchRequest.ByVector(searchEmb) with { Count = 20 });
135135
```
136136

137+
## API Reference
138+
139+
| Method | Redis Command | Returns |
140+
|--------|--------------|---------|
141+
| `VectorSetAddAsync(key, request)` | VADD | `Task<bool>` |
142+
| `VectorSetSimilaritySearchAsync(key, query)` | VSIM | `Task<Lease<VectorSetSimilaritySearchResult>?>` (dispose!) |
143+
| `VectorSetRemoveAsync(key, member)` | VREM | `Task<bool>` |
144+
| `VectorSetContainsAsync(key, member)` | VCONTAINS | `Task<bool>` |
145+
| `VectorSetLengthAsync(key)` | VCARD | `Task<long>` |
146+
| `VectorSetDimensionAsync(key)` | VDIM | `Task<long>` |
147+
| `VectorSetGetAttributesJsonAsync(key, member)` | VGETATTR | `Task<string?>` |
148+
| `VectorSetSetAttributesJsonAsync(key, member, json)` | VSETATTR | `Task<bool>` |
149+
| `VectorSetInfoAsync(key)` | VINFO | `Task<VectorSetInfo?>` |
150+
| `VectorSetRandomMemberAsync(key)` | VRANDMEMBER | `Task<RedisValue>` |
151+
| `VectorSetRandomMembersAsync(key, count)` | VRANDMEMBER | `Task<RedisValue[]>` |
152+
| `VectorSetGetApproximateVectorAsync(key, member)` | VGETAPPROX | `Task<Lease<float>?>` (dispose!) |
153+
| `VectorSetGetLinksAsync(key, member)` | VLINKS | `Task<Lease<RedisValue>?>` (dispose!) |
154+
| `VectorSetGetLinksWithScoresAsync(key, member)` | VLINKS WITHSCORES | `Task<Lease<VectorSetLink>?>` (dispose!) |
155+
156+
**SE.Redis types used:** `VectorSetAddRequest.Member(member, vector)`, `VectorSetSimilaritySearchRequest.ByVector(vector)`, `Lease<T>` (IDisposable — always use `using`).
157+
137158
## Performance Notes
138159

139160
- VectorSet uses HNSW (Hierarchical Navigable Small World) algorithm internally

0 commit comments

Comments
 (0)