You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,7 @@ A lightweight, multi-provider document store for .NET that turns relational data
53
53
-**Batch upsert / update / remove** — `store.BatchUpsert(items)`, `store.BatchUpdate(items)`, and `store.BatchRemove<T>(ids)` apply many writes as one set operation — a single multi-row `INSERT … ON CONFLICT` deep-merge on SQLite/DuckDB, one `BulkWrite`/`DeleteMany` on MongoDB, parallel request waves on Cosmos, and a single `DELETE … IN (…)` for `BatchRemove` on every relational provider. All-or-nothing: the first version conflict rolls the whole batch back.
54
54
-**Spatial / geo queries** — `WithinRadius`, `WithinBoundingBox`, and `NearestNeighbors` methods with `GeoPoint` support. SQLite uses R*Tree virtual tables; CosmosDB uses native `ST_DISTANCE`/`ST_WITHIN`. Configure with `MapSpatialProperty<T>(x => x.Location)`.
55
55
-**Vector / ANN search** — `MapVectorProperty<T>(x => x.Embedding, dimensions: 1536)` + `store.Query<T>().NearestVectors(queryEmbedding, k: 10)` for cross-provider ANN over `ReadOnlyMemory<float>` embeddings. Provider-native indexes: pgvector (PostgreSQL), `VECTOR_DISTANCE` (SQL Server 2025 and Oracle 23ai), DiskANN (CosmosDB), `$vectorSearch` (MongoDB Atlas), `vss` (DuckDB), `sqlite-vec` (SQLite). Cosine / Euclidean / DotProduct everywhere; Hamming on pgvector. Pre-filter via `Where(...)` where the engine supports it. Auto-embed text properties on insert via `Shiny.DocumentDb.Extensions.AI`'s `AutoEmbedOnInsert<T>` hook + `Microsoft.Extensions.AI.IEmbeddingGenerator`.
56
+
-**Full-text search (all providers)** — `MapFullTextProperty<T>(a => a.Body)` (or `[a => a.Title, a => a.Body]`) + `store.FullTextSearch<T>("orleans persistence")` for relevance-ranked text search, returning `FullTextResult<T>` (`Document` + normalized `Score`, higher = better) ordered by relevance, with an optional pre-filter predicate and a fluent `store.Query<T>().Where(...).FullTextMatch("...")` form. The native index is created for you and engine-maintained: FTS5 (SQLite), `tsvector`+GIN (PostgreSQL), `FULLTEXT` (MySQL), Oracle Text (Oracle), Full-Text Index (SQL Server), the `fts` extension (DuckDB), full-text policy (CosmosDB), `$text` (MongoDB), and an in-memory TF-IDF fallback on LiteDB / IndexedDB. Declarative: a type must be mapped before it can be searched. Oracle Text and SQL Server Full-Text Search are optional server components; CosmosDB full-text needs `Microsoft.Azure.Cosmos` 3.61.0+.
56
57
-**Telemetry & observability (`Shiny.DocumentDb.Diagnostics`)** — `services.AddDocumentStoreInstrumentation()` wraps any provider in a decorator that emits OpenTelemetry-native metrics (`db.client.operation.duration` + an operations counter + a returned-rows histogram, tagged per the OTel DB semantic conventions) and an `ActivitySource` client span per operation. Covers CRUD, the fluent-query terminals, the temporal `ITemporalDocumentStore` ops, and `UnitOfWork.SaveChanges` (inner ops become child spans). Built on `System.Diagnostics.Metrics`/`IMeterFactory`; subscribe with `.AddMeter("Shiny.DocumentDb")` / `.AddSource("Shiny.DocumentDb")`. Zero-cost when nobody is listening; never records document bodies or ids.
57
58
-**Hot backup** — `store.Backup("/path/to/backup.db")` copies the database to a file. Available on `SqliteDocumentStore`, `SqlCipherDocumentStore`, and `LiteDbDocumentStore` (not on the `IDocumentStore` interface).
58
59
-**Clear the whole store (`IDocumentMaintenance.ClearAll`)** — `((IDocumentMaintenance)store).ClearAll()` wipes every document type (plus temporal-history, spatial, and vector sidecars) for test/dev resets. A whole-store wipe — not type- or tenant-scoped (use `Clear<T>()` for one type) — that targets only user tables in the current database and never the system catalogs. Implemented on the relational `DocumentStore` (SQLite, SQL Server, PostgreSQL, MySQL, DuckDB, Oracle), MongoDB, and CosmosDB; `SqliteDocumentStore.ClearAllAsync()` still works and delegates to it.
Copy file name to clipboardExpand all lines: skills/shiny-documentdb/SKILL.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,14 @@ triggers:
23
23
- vector search
24
24
- NearestVectors
25
25
- MapVectorProperty
26
+
- full-text search
27
+
- FullTextSearch
28
+
- FullTextMatch
29
+
- MapFullTextProperty
30
+
- FullTextResult
31
+
- FullTextLanguage
32
+
- FTS5
33
+
- tsvector
26
34
- sqlite-vec
27
35
- VectorExtensionPreloaded
28
36
- EnableVectorExtension
@@ -1442,6 +1450,30 @@ If you supply your own binary, two mutually complementary flags on `SqliteDataba
1442
1450
1443
1451
Either flag (or the package helper) makes `SupportsVector` return `true`. Without one, `NearestVectors` throws `NotSupportedException`. vec0 is flat-scan (no HNSW); when a `.Where(...)` filter is combined with the search, the library over-fetches `k * postFilterMultiplier` (default 4) candidates.
1444
1452
1453
+
## Full-Text Search
1454
+
1455
+
Relevance-ranked text search over one or more string properties. **Declarative and up-front**: map the searchable property with `MapFullTextProperty<T>(...)` and the library creates the native index for you at startup. A type **must be mapped before it can be searched** — there is no ad-hoc full-text (unlike `.Where(x => x.Body.Contains(...))`, which works on any field). Supported on **every provider**: FTS5 (SQLite), `tsvector`+GIN (PostgreSQL), `FULLTEXT` (MySQL), Oracle Text (Oracle), Full-Text Index (SQL Server), the `fts` extension (DuckDB), full-text policy (Cosmos), `$text` (MongoDB), and an in-memory TF-IDF scan on LiteDB / IndexedDB.
1456
+
1457
+
```csharp
1458
+
// single field, or several combined into one index
0 commit comments