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
@@ -84,16 +79,16 @@ Built with [RavenDB](https://ravendb.net/), [Aspire](https://aspire.dev/), [Azur
84
79
using var session = store.OpenAsyncSession();
85
80
86
81
var book = await session
87
-
.Include<Book>(b => b.AuthorId)
88
-
.Include<Book>(b => b.CategoryId)
89
-
.LoadAsync<Book>("books/1-A");
82
+
.Include<Book>(b => b.AuthorId)
83
+
.Include<Book>(b => b.CategoryId)
84
+
.LoadAsync<Book>("books/1-A");
90
85
91
86
// These are already loaded - no additional DB calls
92
-
var author = await session.LoadAsync<Author>(book.AuthorId);
93
-
var category = await session.LoadAsync<Category>(book.CategoryId);
87
+
var author = await session.LoadAsync<Author>(book.AuthorId);
88
+
var category = await session.LoadAsync<Category>(book.CategoryId);
94
89
95
90
// Example: Loading multiple books with their authors
96
-
var books = await session.Query<Book>()
91
+
var books = await session.Query<Book>()
97
92
.Include(b => b.AuthorId)
98
93
.Where(b => b.IsAvailable)
99
94
.ToListAsync();
@@ -105,23 +100,106 @@ Built with [RavenDB](https://ravendb.net/), [Aspire](https://aspire.dev/), [Azur
105
100
description="Semantic search powered by AI embeddings for intelligent content discovery."
106
101
icon="vector-search"
107
102
>
108
-
Vector search enables semantic similarity matching, allowing users to find books based on meaning rather than just keywords.
103
+
RavenDB's Vector Search enables semantic similarity queries for discovering related books. The Library uses AI-generated embeddings to power a 'Similar Books' feature, finding conceptually related titles even when they share no common keywords.
104
+
105
+
Implementation example:
106
+
107
+
```csharp
108
+
// Define a vector index for book embeddings
109
+
public class Books_ByEmbedding : AbstractIndexCreationTask<Book>
110
+
{
111
+
publicBooks_ByEmbedding()
112
+
{
113
+
Map=books=>frombookinbooks
114
+
select new
115
+
{
116
+
book.Title,
117
+
book.Description,
118
+
// Vector field for semantic search
119
+
Embedding=CreateField("Embedding",
120
+
book.Embedding,
121
+
stored: false,
122
+
indexing: FieldIndexing.Default)
123
+
};
124
+
}
125
+
}
126
+
127
+
// Find similar books using vector search
128
+
var similarBooks = await session
129
+
.Query<Book,Books_ByEmbedding>()
130
+
.VectorSearch(
131
+
field: b => b.Embedding,
132
+
queryVector: currentBook.Embedding,
133
+
minimumSimilarity: 0.7f)
134
+
.Take(5)
135
+
.ToListAsync();
136
+
```
109
137
</FeatureAccordion>
110
138
111
139
<FeatureAccordion
112
140
title="Azure Storage Queues ETL"
113
141
description="Reliable data integration with Azure Storage Queues."
114
142
icon="azure-queue-storage-etl"
115
143
>
116
-
ETL to Azure Storage Queues ensures that all library updates are reliably propagated to downstream systems.
144
+
RavenDB's ETL (Extract, Transform, Load) to Azure Storage Queues enables real-time data streaming. Combined with @refresh, the Library sends notifications about expiring book loans to Azure Functions for processing email reminders.
description="Automatic document updates based on external data sources."
122
177
icon="document-refresh"
123
178
>
124
-
Document Refresh keeps book metadata up-to-date by automatically fetching the latest information from external APIs.
179
+
Document Refresh enables automatic re-indexing of documents at specified times using the @refresh metadata. The Library uses this for handling book loan timeouts - when a book's return date approaches, RavenDB automatically refreshes the document, triggering downstream processes.
0 commit comments