Skip to content

Commit db3d92d

Browse files
authored
Merge pull request #1989 from Danielle9897/RDoc-3252-directoryForVectorSearch
RDoc-3184 Create a dedicated directory for Vector Search
2 parents ed6fd64 + 4d46e4a commit db3d92d

16 files changed

+261
-254
lines changed
Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,7 @@
11
[
22
{
3-
"Path": "ravendb-as-vector-database.markdown",
4-
"Name": "RavenDB as a Vector Database",
5-
"DiscussionId": "3a848621-110f-4bbd-9147-58f743b0a950",
6-
"Mappings": []
7-
},
8-
{
9-
"Path": "vector-search-using-dynamic-query.markdown",
10-
"Name": "Vector Search using a Dynamic Query",
11-
"DiscussionId": "2b55d124-a9ff-474c-8171-d065daf938a3",
12-
"Mappings": []
13-
},
14-
{
15-
"Path": "vector-search-using-static-index.markdown",
16-
"Name": "Vector Search using a Static Index",
17-
"DiscussionId": "a25c7cca-e662-401f-9b66-8ce1102a2a09",
18-
"Mappings": []
19-
},
20-
{
21-
"Path": "indexing-attachments-for-vector-search.markdown",
22-
"Name": "Indexing Attachments for Vector Search",
23-
"DiscussionId": "7510d989-4925-4e7d-8c48-c3608c09506c",
24-
"Mappings": []
25-
},
26-
{
27-
"Path": "data-types-for-vector-search.markdown",
28-
"Name": "Data Types for Vector Search",
29-
"DiscussionId": "251b7f9e-06a8-4a67-8707-4a87ee9e5d7d",
3+
"Path": "/vector-search",
4+
"Name": "Vector Search",
305
"Mappings": []
316
}
327
]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[
2+
{
3+
"Path": "ravendb-as-vector-database.markdown",
4+
"Name": "RavenDB as a Vector Database",
5+
"DiscussionId": "3a848621-110f-4bbd-9147-58f743b0a950",
6+
"Mappings": []
7+
},
8+
{
9+
"Path": "vector-search-using-dynamic-query.markdown",
10+
"Name": "Vector Search using a Dynamic Query",
11+
"DiscussionId": "2b55d124-a9ff-474c-8171-d065daf938a3",
12+
"Mappings": []
13+
},
14+
{
15+
"Path": "vector-search-using-static-index.markdown",
16+
"Name": "Vector Search using a Static Index",
17+
"DiscussionId": "a25c7cca-e662-401f-9b66-8ce1102a2a09",
18+
"Mappings": []
19+
},
20+
{
21+
"Path": "indexing-attachments-for-vector-search.markdown",
22+
"Name": "Indexing Attachments for Vector Search",
23+
"DiscussionId": "7510d989-4925-4e7d-8c48-c3608c09506c",
24+
"Mappings": []
25+
},
26+
{
27+
"Path": "data-types-for-vector-search.markdown",
28+
"Name": "Data Types for Vector Search",
29+
"DiscussionId": "251b7f9e-06a8-4a67-8707-4a87ee9e5d7d",
30+
"Mappings": []
31+
}
32+
]

Documentation/7.0/Raven.Documentation.Pages/ai-integration/data-types-for-vector-search.dotnet.markdown renamed to Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/data-types-for-vector-search.dotnet.markdown

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
as outlined below.
88

99
* Text and numerical data that is not pre-quantized can be further quantized in the generated embeddings.
10-
Learn more in [Quantization options](../ai-integration/vector-search-using-dynamic-query#quantization-options).
10+
Learn more in [Quantization options](../../ai-integration/vector-search/vector-search-using-dynamic-query#quantization-options).
1111

1212
* In this page:
13-
* [Supported data types for vector search](../ai-integration/data-types-for-vector-search#supported-data-types-for-vector-search)
14-
* [Textual data](../ai-integration/data-types-for-vector-search#textual-data)
15-
* [Numerical data](../ai-integration/data-types-for-vector-search#numerical-data)
16-
* [RavenVector](../ai-integration/data-types-for-vector-search#ravenvector)
13+
* [Supported data types for vector search](../../ai-integration/vector-search/data-types-for-vector-search#supported-data-types-for-vector-search)
14+
* [Textual data](../../ai-integration/vector-search/data-types-for-vector-search#textual-data)
15+
* [Numerical data](../../ai-integration/vector-search/data-types-for-vector-search#numerical-data)
16+
* [RavenVector](../../ai-integration/vector-search/data-types-for-vector-search#ravenvector)
1717

1818
{NOTE/}
1919

@@ -41,7 +41,7 @@
4141
* Ensure that all vectors within this field across all documents in the collection are generated by the **same model** and model version and have the **same dimensions**.
4242
* Consistency in both dimensionality and model source is crucial for meaningful comparisons in the vector space.
4343

44-
* In addition to the native types described below, we highly recommended using [RavenVector](../ai-integration/data-types-for-vector-search#ravenvector)
44+
* In addition to the native types described below, we highly recommended using [RavenVector](../ai-integration/vector-search/data-types-for-vector-search#ravenvector)
4545
for efficient storage and fast queries when working with numerical embeddings.
4646

4747
{CONTENT-FRAME: }
@@ -61,7 +61,7 @@ Use when you prioritize storage efficiency and query speed.
6161
`byte[] / sbyte[]` - A single pre-quantized embedding vector in the _Int8_ or _Binary_ quantization format.
6262
`byte[][] / sbyte[][]` - An array of pre-quantized embedding vectors.
6363

64-
When storing data in these formats in your documents, you should use [RavenDB’s vector quantizer methods](../ai-integration/vector-search-using-dynamic-query#section-1).
64+
When storing data in these formats in your documents, you should use [RavenDB’s vector quantizer methods](../../ai-integration/vector-search/vector-search-using-dynamic-query#section-1).
6565

6666
{CONTENT-FRAME/}
6767
{CONTENT-FRAME: }
@@ -106,7 +106,7 @@ When a class property is stored as a `RavenVector`, the vector's content will ap
106106
For example:
107107

108108
{CODE-TABS}
109-
{CODE-TAB:csharp:CSharp_class class@AiIntegration\DataTypes.cs /}
109+
{CODE-TAB:csharp:CSharp_class class@AiIntegration\VectorSearch\DataTypes.cs /}
110110
{CODE-TABS/}
111111

112112
![json document](images/json-document.png "RavenVector in a JSON document")
@@ -117,14 +117,14 @@ For example:
117117

118118
### Vector Search
119119

120-
- [RavenDB as a vector database](../ai-integration/ravendb-as-vector-database)
121-
- [Vector search using a static index](../ai-integration/vector-search-using-static-index)
122-
- [Vector search using a dynamic query](../ai-integration/vector-search-using-dynamic-query)
120+
- [RavenDB as a vector database](../../ai-integration/vector-search/ravendb-as-vector-database)
121+
- [Vector search using a static index](../../ai-integration/vector-search/vector-search-using-static-index)
122+
- [Vector search using a dynamic query](../../ai-integration/vector-search/vector-search-using-dynamic-query)
123123

124124
### Querying
125125

126-
- [Query overview](../client-api/session/querying/how-to-query)
127-
- [Full-text search](../client-api/session/querying/text-search/full-text-search)
126+
- [Query overview](../../client-api/session/querying/how-to-query)
127+
- [Full-text search](../../client-api/session/querying/text-search/full-text-search)
128128

129129

130130

Documentation/7.0/Raven.Documentation.Pages/ai-integration/indexing-attachments-for-vector-search.dotnet.markdown renamed to Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/indexing-attachments-for-vector-search.dotnet.markdown

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
{NOTE: }
55

66
* This article explains how to index attachments using a **static-index** to enable vector search on their content.
7-
Note: Vector search on attachment content is not available when making a [dynamic query](../ai-integration/vector-search-using-dynamic-query).
7+
Note: Vector search on attachment content is not available when making a [dynamic query](../../ai-integration/vector-search/vector-search-using-dynamic-query).
88

9-
* **Prior to this article**, refer to the [Vector search using a static index](../ai-integration/vector-search-using-static-index) article for general knowledge about
9+
* **Prior to this article**, refer to the [Vector search using a static index](../../ai-integration/vector-search/vector-search-using-static-index) article for general knowledge about
1010
indexing a vector field.
1111

1212
* In this page:
13-
* [Overview](../ai-integration/indexing-attachments-for-vector-search#overview)
14-
* [Indexing TEXT attachments](../ai-integration/indexing-attachments-for-vector-search#indexing-text-attachments)
15-
* [Indexing NUMERICAL attachments](../ai-integration/indexing-attachments-for-vector-search#indexing-numerical-attachments)
16-
* [LINQ index](../ai-integration/indexing-attachments-for-vector-search#linq-index)
17-
* [JS index](../ai-integration/indexing-attachments-for-vector-search#js-index)
18-
* [Indexing ALL attachments](../ai-integration/indexing-attachments-for-vector-search#indexing-all-attachments)
13+
* [Overview](../../ai-integration/vector-search/indexing-attachments-for-vector-search#overview)
14+
* [Indexing TEXT attachments](../../ai-integration/vector-search/indexing-attachments-for-vector-search#indexing-text-attachments)
15+
* [Indexing NUMERICAL attachments](../../ai-integration/vector-search/indexing-attachments-for-vector-search#indexing-numerical-attachments)
16+
* [LINQ index](../../ai-integration/vector-search/indexing-attachments-for-vector-search#linq-index)
17+
* [JS index](../../ai-integration/vector-search/indexing-attachments-for-vector-search#js-index)
18+
* [Indexing ALL attachments](../../ai-integration/vector-search/indexing-attachments-for-vector-search#indexing-all-attachments)
1919

2020
{NOTE/}
2121

@@ -36,7 +36,7 @@
3636
They are stored as **binary data**, regardless of content type.
3737

3838
* Attachments are handled as streams, allowing efficient upload and retrieval.
39-
Learn more in: [What are attachments](../document-extensions/attachments/what-are-attachments).
39+
Learn more in: [What are attachments](../../document-extensions/attachments/what-are-attachments).
4040

4141
{CONTENT-FRAME/}
4242
{CONTENT-FRAME: }
@@ -55,7 +55,7 @@ enabling vector search on text or numerical data that is stored in the attachmen
5555
* **Attachments with NUMERICAL data**:
5656
* While attachments can store any file type, RavenDB does Not generate embeddings from images, videos, or other non-textual content.
5757
Each attachment must contain a **single** precomputed embedding vector, generated externally.
58-
* RavenDB indexes the embedding vector from the attachment in and can apply [quantization](../ai-integration/vector-search-using-dynamic-query#quantization-options)
58+
* RavenDB indexes the embedding vector from the attachment in and can apply [quantization](../../ai-integration/vector-search/vector-search-using-dynamic-query#quantization-options)
5959
(e.g., index it in _Int8_ format) if this is configured.
6060
* All embeddings indexed within the same vector-field in the static-index must be vectors of the **same dimension** to ensure consistency in indexing and search.
6161
They must also be created using the **same model**.
@@ -71,22 +71,22 @@ enabling vector search on text or numerical data that is stored in the attachmen
7171
This applies to all _Company_ documents that contain an attachment with that name.
7272

7373
{CODE-TABS}
74-
{CODE-TAB:csharp:LINQ_index index_1@AiIntegration\VectorSearchWithAttachments.cs /}
75-
{CODE-TAB:csharp:JS_index index_2@AiIntegration\VectorSearchWithAttachments.cs /}
76-
{CODE-TAB:csharp:IndexDefinition index_3@AiIntegration\VectorSearchWithAttachments.cs /}
77-
{CODE-TAB:csharp:Storing_text_attachments store_attachments_1@AiIntegration\VectorSearchWithAttachments.cs /}
74+
{CODE-TAB:csharp:LINQ_index index_1@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
75+
{CODE-TAB:csharp:JS_index index_2@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
76+
{CODE-TAB:csharp:IndexDefinition index_3@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
77+
{CODE-TAB:csharp:Storing_text_attachments store_attachments_1@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
7878
{CODE-TABS/}
7979

8080
Execute a vector search using the index:
8181
Results will include _Company_ documents whose attachment contains text similar to `"chinese food"`.
8282

8383
{CODE-TABS}
84-
{CODE-TAB:csharp:Query query_1@AiIntegration\VectorSearchWithAttachments.cs /}
85-
{CODE-TAB:csharp:Query_async query_1_async@AiIntegration\VectorSearchWithAttachments.cs /}
86-
{CODE-TAB:csharp:DocumentQuery query_2@AiIntegration\VectorSearchWithAttachments.cs /}
87-
{CODE-TAB:csharp:DocumentQuery_async query_2_async@AiIntegration\VectorSearchWithAttachments.cs /}
88-
{CODE-TAB:csharp:RawQuery query_3@AiIntegration\VectorSearchWithAttachments.cs /}
89-
{CODE-TAB:csharp:RawQuery_async query_3_async@AiIntegration\VectorSearchWithAttachments.cs /}
84+
{CODE-TAB:csharp:Query query_1@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
85+
{CODE-TAB:csharp:Query_async query_1_async@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
86+
{CODE-TAB:csharp:DocumentQuery query_2@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
87+
{CODE-TAB:csharp:DocumentQuery_async query_2_async@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
88+
{CODE-TAB:csharp:RawQuery query_3@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
89+
{CODE-TAB:csharp:RawQuery_async query_3_async@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
9090
{CODE-TAB-BLOCK:sql:RQL}
9191
from index "Companies/ByVector/FromTextAttachment"
9292
where vector.search(VectorFromAttachment, $searchTerm, 0.8)
@@ -96,7 +96,7 @@ where vector.search(VectorFromAttachment, $searchTerm, 0.8)
9696

9797
You can now extract the text from the attachments of the resulting documents:
9898

99-
{CODE:csharp extract_attachment_content@AiIntegration\VectorSearchWithAttachments.cs /}
99+
{CODE:csharp extract_attachment_content@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
100100

101101
{PANEL/}
102102

@@ -112,21 +112,21 @@ You can now extract the text from the attachments of the resulting documents:
112112
* Each attachment contains raw numerical data in 32-bit floating-point format.
113113

114114
{CODE-TABS}
115-
{CODE-TAB:csharp:LINQ_index index_4@AiIntegration\VectorSearchWithAttachments.cs /}
116-
{CODE-TAB:csharp:IndexDefinition index_5@AiIntegration\VectorSearchWithAttachments.cs /}
117-
{CODE-TAB:csharp:Storing_numerical_attachments store_attachments_2@AiIntegration\VectorSearchWithAttachments.cs /}
115+
{CODE-TAB:csharp:LINQ_index index_4@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
116+
{CODE-TAB:csharp:IndexDefinition index_5@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
117+
{CODE-TAB:csharp:Storing_numerical_attachments store_attachments_2@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
118118
{CODE-TABS/}
119119

120120
Execute a vector search using the index:
121121
Results will include _Company_ documents whose attachment contains vectors similar to the query vector.
122122

123123
{CODE-TABS}
124-
{CODE-TAB:csharp:Query query_4@AiIntegration\VectorSearchWithAttachments.cs /}
125-
{CODE-TAB:csharp:Query_async query_4_async@AiIntegration\VectorSearchWithAttachments.cs /}
126-
{CODE-TAB:csharp:DocumentQuery query_5@AiIntegration\VectorSearchWithAttachments.cs /}
127-
{CODE-TAB:csharp:DocumentQuery_async query_5_async@AiIntegration\VectorSearchWithAttachments.cs /}
128-
{CODE-TAB:csharp:RawQuery query_6@AiIntegration\VectorSearchWithAttachments.cs /}
129-
{CODE-TAB:csharp:RawQuery_async query_6_async@AiIntegration\VectorSearchWithAttachments.cs /}
124+
{CODE-TAB:csharp:Query query_4@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
125+
{CODE-TAB:csharp:Query_async query_4_async@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
126+
{CODE-TAB:csharp:DocumentQuery query_5@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
127+
{CODE-TAB:csharp:DocumentQuery_async query_5_async@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
128+
{CODE-TAB:csharp:RawQuery query_6@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
129+
{CODE-TAB:csharp:RawQuery_async query_6_async@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
130130
{CODE-TAB-BLOCK:sql:RQL}
131131
from index "Companies/ByVector/FromNumericalAttachment"
132132
where vector.search(VectorFromAttachment, $queryVector)
@@ -138,23 +138,23 @@ where vector.search(VectorFromAttachment, $queryVector)
138138

139139
### JS index
140140

141-
* The following is the JavaScript index format equivalent to the [LINQ index](../ai-integration/indexing-attachments-for-vector-search#linq-index) shown above.
141+
* The following is the JavaScript index format equivalent to the [LINQ index](../../ai-integration/vector-search/indexing-attachments-for-vector-search#linq-index) shown above.
142142

143143
* The main difference is that JavaScript indexes do Not support `getContentAsStream()` on attachment objects:
144144
* Because of this, embedding vectors must be stored in attachments as **Base64-encoded strings**.
145145
* Use `getContentAsString()` to retrieve the attachment content as a string, as shown in this example.
146146

147147
{CODE-TABS}
148-
{CODE-TAB:csharp:JS_index index_6@AiIntegration\VectorSearchWithAttachments.cs /}
149-
{CODE-TAB:csharp:Storing_numerical_attachments_as_base64 store_attachments_3@AiIntegration\VectorSearchWithAttachments.cs /}
148+
{CODE-TAB:csharp:JS_index index_6@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
149+
{CODE-TAB:csharp:Storing_numerical_attachments_as_base64 store_attachments_3@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
150150
{CODE-TABS/}
151151

152152
Execute a vector search using the index:
153153
Results will include _Company_ documents whose attachment contains vectors similar to the query vector.
154154

155155
{CODE-TABS}
156-
{CODE-TAB:csharp:RawQuery query_7@AiIntegration\VectorSearchWithAttachments.cs /}
157-
{CODE-TAB:csharp:RawQuery_async query_7_async@AiIntegration\VectorSearchWithAttachments.cs /}
156+
{CODE-TAB:csharp:RawQuery query_7@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
157+
{CODE-TAB:csharp:RawQuery_async query_7_async@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
158158
{CODE-TAB-BLOCK:sql:RQL}
159159
from index "Companies/ByVector/FromNumericalAttachment/JS"
160160
where vector.search(VectorFromAttachment, $queryVector)
@@ -171,21 +171,21 @@ where vector.search(VectorFromAttachment, $queryVector)
171171
* It indexes embeddings generated from the numerical data stored in ALL attachments of all _Company_ documents.
172172

173173
{CODE-TABS}
174-
{CODE-TAB:csharp:LINQ_index index_7@AiIntegration\VectorSearchWithAttachments.cs /}
175-
{CODE-TAB:csharp:IndexDefinition index_8@AiIntegration\VectorSearchWithAttachments.cs /}
176-
{CODE-TAB:csharp:Storing_numerical_attachments store_attachments_4@AiIntegration\VectorSearchWithAttachments.cs /}
174+
{CODE-TAB:csharp:LINQ_index index_7@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
175+
{CODE-TAB:csharp:IndexDefinition index_8@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
176+
{CODE-TAB:csharp:Storing_numerical_attachments store_attachments_4@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
177177
{CODE-TABS/}
178178

179179
Execute a vector search using the index:
180180
Results will include Company documents whose attachments contains vectors similar to the query vector.
181181

182182
{CODE-TABS}
183-
{CODE-TAB:csharp:Query query_8@AiIntegration\VectorSearchWithAttachments.cs /}
184-
{CODE-TAB:csharp:Query_async query_8_async@AiIntegration\VectorSearchWithAttachments.cs /}
185-
{CODE-TAB:csharp:DocumentQuery query_9@AiIntegration\VectorSearchWithAttachments.cs /}
186-
{CODE-TAB:csharp:DocumentQuery_async query_9_async@AiIntegration\VectorSearchWithAttachments.cs /}
187-
{CODE-TAB:csharp:RawQuery query_10@AiIntegration\VectorSearchWithAttachments.cs /}
188-
{CODE-TAB:csharp:RawQuery_async query_10_async@AiIntegration\VectorSearchWithAttachments.cs /}
183+
{CODE-TAB:csharp:Query query_8@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
184+
{CODE-TAB:csharp:Query_async query_8_async@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
185+
{CODE-TAB:csharp:DocumentQuery query_9@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
186+
{CODE-TAB:csharp:DocumentQuery_async query_9_async@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
187+
{CODE-TAB:csharp:RawQuery query_10@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
188+
{CODE-TAB:csharp:RawQuery_async query_10_async@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /}
189189
{CODE-TAB-BLOCK:sql:RQL}
190190
from index "Companies/ByVector/AllAttachments"
191191
where vector.search(VectorFromAttachment, $queryVector)
@@ -199,11 +199,11 @@ where vector.search(VectorFromAttachment, $queryVector)
199199

200200
### Vector Search
201201

202-
- [RavenDB as a vector database](../ai-integration/ravendb-as-vector-database)
203-
- [Vector search using a dynamic query](../ai-integration/vector-search-using-dynamic-query)
204-
- [Vector search using a static index](../ai-integration/vector-search-using-static-index)
202+
- [RavenDB as a vector database](../../ai-integration/vector-search/ravendb-as-vector-database)
203+
- [Vector search using a dynamic query](../../ai-integration/vector-search/vector-search-using-dynamic-query)
204+
- [Vector search using a static index](../../ai-integration/vector-search/vector-search-using-static-index)
205205

206206
### Querying
207207

208-
- [Query overview](../client-api/session/querying/how-to-query)
209-
- [Full-text search](../client-api/session/querying/text-search/full-text-search)
208+
- [Query overview](../../client-api/session/querying/how-to-query)
209+
- [Full-text search](../../client-api/session/querying/text-search/full-text-search)

0 commit comments

Comments
 (0)