From 4d46e4a9dcefebe8abbded7022cc02fe31ea0168 Mon Sep 17 00:00:00 2001 From: danielle9897 Date: Mon, 24 Feb 2025 14:12:35 +0200 Subject: [PATCH] RDoc-3184 Create a dedicated directory for Vector Search (to differentiate from the other tasks that we will have) --- .../ai-integration/.docs.json | 29 +-- .../ai-integration/vector-search/.docs.json | 32 ++++ ...ta-types-for-vector-search.dotnet.markdown | 26 +-- .../images/add-vector-field-1.png | Bin .../images/add-vector-field-2.png | Bin .../images/json-document.png | Bin .../images/vector-search-1.png | Bin .../images/vector-search-2.png | Bin ...achments-for-vector-search.dotnet.markdown | 98 +++++----- .../ravendb-as-vector-database.markdown | 26 +-- ...search-using-dynamic-query.dotnet.markdown | 178 +++++++++--------- ...-search-using-static-index.dotnet.markdown | 126 ++++++------- .../{ => VectorSearch}/DataTypes.cs | 0 .../VectorSearchUsingDynamicQuery.cs | 0 .../VectorSearchUsingStaticIndex.cs | 0 .../VectorSearchWithAttachments.cs | 0 16 files changed, 261 insertions(+), 254 deletions(-) create mode 100644 Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/.docs.json rename Documentation/7.0/Raven.Documentation.Pages/ai-integration/{ => vector-search}/data-types-for-vector-search.dotnet.markdown (72%) rename Documentation/7.0/Raven.Documentation.Pages/ai-integration/{ => vector-search}/images/add-vector-field-1.png (100%) rename Documentation/7.0/Raven.Documentation.Pages/ai-integration/{ => vector-search}/images/add-vector-field-2.png (100%) rename Documentation/7.0/Raven.Documentation.Pages/ai-integration/{ => vector-search}/images/json-document.png (100%) rename Documentation/7.0/Raven.Documentation.Pages/ai-integration/{ => vector-search}/images/vector-search-1.png (100%) rename Documentation/7.0/Raven.Documentation.Pages/ai-integration/{ => vector-search}/images/vector-search-2.png (100%) rename Documentation/7.0/Raven.Documentation.Pages/ai-integration/{ => vector-search}/indexing-attachments-for-vector-search.dotnet.markdown (62%) rename Documentation/7.0/Raven.Documentation.Pages/ai-integration/{ => vector-search}/ravendb-as-vector-database.markdown (76%) rename Documentation/7.0/Raven.Documentation.Pages/ai-integration/{ => vector-search}/vector-search-using-dynamic-query.dotnet.markdown (75%) rename Documentation/7.0/Raven.Documentation.Pages/ai-integration/{ => vector-search}/vector-search-using-static-index.dotnet.markdown (63%) rename Documentation/7.0/Samples/csharp/Raven.Documentation.Samples/AiIntegration/{ => VectorSearch}/DataTypes.cs (100%) rename Documentation/7.0/Samples/csharp/Raven.Documentation.Samples/AiIntegration/{ => VectorSearch}/VectorSearchUsingDynamicQuery.cs (100%) rename Documentation/7.0/Samples/csharp/Raven.Documentation.Samples/AiIntegration/{ => VectorSearch}/VectorSearchUsingStaticIndex.cs (100%) rename Documentation/7.0/Samples/csharp/Raven.Documentation.Samples/AiIntegration/{ => VectorSearch}/VectorSearchWithAttachments.cs (100%) diff --git a/Documentation/7.0/Raven.Documentation.Pages/ai-integration/.docs.json b/Documentation/7.0/Raven.Documentation.Pages/ai-integration/.docs.json index f862aa778..2ec7e9e42 100644 --- a/Documentation/7.0/Raven.Documentation.Pages/ai-integration/.docs.json +++ b/Documentation/7.0/Raven.Documentation.Pages/ai-integration/.docs.json @@ -1,32 +1,7 @@ [ { - "Path": "ravendb-as-vector-database.markdown", - "Name": "RavenDB as a Vector Database", - "DiscussionId": "3a848621-110f-4bbd-9147-58f743b0a950", - "Mappings": [] - }, - { - "Path": "vector-search-using-dynamic-query.markdown", - "Name": "Vector Search using a Dynamic Query", - "DiscussionId": "2b55d124-a9ff-474c-8171-d065daf938a3", - "Mappings": [] - }, - { - "Path": "vector-search-using-static-index.markdown", - "Name": "Vector Search using a Static Index", - "DiscussionId": "a25c7cca-e662-401f-9b66-8ce1102a2a09", - "Mappings": [] - }, - { - "Path": "indexing-attachments-for-vector-search.markdown", - "Name": "Indexing Attachments for Vector Search", - "DiscussionId": "7510d989-4925-4e7d-8c48-c3608c09506c", - "Mappings": [] - }, - { - "Path": "data-types-for-vector-search.markdown", - "Name": "Data Types for Vector Search", - "DiscussionId": "251b7f9e-06a8-4a67-8707-4a87ee9e5d7d", + "Path": "/vector-search", + "Name": "Vector Search", "Mappings": [] } ] diff --git a/Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/.docs.json b/Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/.docs.json new file mode 100644 index 000000000..f862aa778 --- /dev/null +++ b/Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/.docs.json @@ -0,0 +1,32 @@ +[ + { + "Path": "ravendb-as-vector-database.markdown", + "Name": "RavenDB as a Vector Database", + "DiscussionId": "3a848621-110f-4bbd-9147-58f743b0a950", + "Mappings": [] + }, + { + "Path": "vector-search-using-dynamic-query.markdown", + "Name": "Vector Search using a Dynamic Query", + "DiscussionId": "2b55d124-a9ff-474c-8171-d065daf938a3", + "Mappings": [] + }, + { + "Path": "vector-search-using-static-index.markdown", + "Name": "Vector Search using a Static Index", + "DiscussionId": "a25c7cca-e662-401f-9b66-8ce1102a2a09", + "Mappings": [] + }, + { + "Path": "indexing-attachments-for-vector-search.markdown", + "Name": "Indexing Attachments for Vector Search", + "DiscussionId": "7510d989-4925-4e7d-8c48-c3608c09506c", + "Mappings": [] + }, + { + "Path": "data-types-for-vector-search.markdown", + "Name": "Data Types for Vector Search", + "DiscussionId": "251b7f9e-06a8-4a67-8707-4a87ee9e5d7d", + "Mappings": [] + } +] diff --git a/Documentation/7.0/Raven.Documentation.Pages/ai-integration/data-types-for-vector-search.dotnet.markdown b/Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/data-types-for-vector-search.dotnet.markdown similarity index 72% rename from Documentation/7.0/Raven.Documentation.Pages/ai-integration/data-types-for-vector-search.dotnet.markdown rename to Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/data-types-for-vector-search.dotnet.markdown index c8b97c6a7..00a65af47 100644 --- a/Documentation/7.0/Raven.Documentation.Pages/ai-integration/data-types-for-vector-search.dotnet.markdown +++ b/Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/data-types-for-vector-search.dotnet.markdown @@ -7,13 +7,13 @@ as outlined below. * Text and numerical data that is not pre-quantized can be further quantized in the generated embeddings. - Learn more in [Quantization options](../ai-integration/vector-search-using-dynamic-query#quantization-options). + Learn more in [Quantization options](../../ai-integration/vector-search/vector-search-using-dynamic-query#quantization-options). * In this page: - * [Supported data types for vector search](../ai-integration/data-types-for-vector-search#supported-data-types-for-vector-search) - * [Textual data](../ai-integration/data-types-for-vector-search#textual-data) - * [Numerical data](../ai-integration/data-types-for-vector-search#numerical-data) - * [RavenVector](../ai-integration/data-types-for-vector-search#ravenvector) + * [Supported data types for vector search](../../ai-integration/vector-search/data-types-for-vector-search#supported-data-types-for-vector-search) + * [Textual data](../../ai-integration/vector-search/data-types-for-vector-search#textual-data) + * [Numerical data](../../ai-integration/vector-search/data-types-for-vector-search#numerical-data) + * [RavenVector](../../ai-integration/vector-search/data-types-for-vector-search#ravenvector) {NOTE/} @@ -41,7 +41,7 @@ * 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**. * Consistency in both dimensionality and model source is crucial for meaningful comparisons in the vector space. -* In addition to the native types described below, we highly recommended using [RavenVector](../ai-integration/data-types-for-vector-search#ravenvector) +* In addition to the native types described below, we highly recommended using [RavenVector](../ai-integration/vector-search/data-types-for-vector-search#ravenvector) for efficient storage and fast queries when working with numerical embeddings. {CONTENT-FRAME: } @@ -61,7 +61,7 @@ Use when you prioritize storage efficiency and query speed. `byte[] / sbyte[]` - A single pre-quantized embedding vector in the _Int8_ or _Binary_ quantization format. `byte[][] / sbyte[][]` - An array of pre-quantized embedding vectors. -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). +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). {CONTENT-FRAME/} {CONTENT-FRAME: } @@ -106,7 +106,7 @@ When a class property is stored as a `RavenVector`, the vector's content will ap For example: {CODE-TABS} -{CODE-TAB:csharp:CSharp_class class@AiIntegration\DataTypes.cs /} +{CODE-TAB:csharp:CSharp_class class@AiIntegration\VectorSearch\DataTypes.cs /} {CODE-TABS/} ![json document](images/json-document.png "RavenVector in a JSON document") @@ -117,14 +117,14 @@ For example: ### Vector Search -- [RavenDB as a vector database](../ai-integration/ravendb-as-vector-database) -- [Vector search using a static index](../ai-integration/vector-search-using-static-index) -- [Vector search using a dynamic query](../ai-integration/vector-search-using-dynamic-query) +- [RavenDB as a vector database](../../ai-integration/vector-search/ravendb-as-vector-database) +- [Vector search using a static index](../../ai-integration/vector-search/vector-search-using-static-index) +- [Vector search using a dynamic query](../../ai-integration/vector-search/vector-search-using-dynamic-query) ### Querying -- [Query overview](../client-api/session/querying/how-to-query) -- [Full-text search](../client-api/session/querying/text-search/full-text-search) +- [Query overview](../../client-api/session/querying/how-to-query) +- [Full-text search](../../client-api/session/querying/text-search/full-text-search) diff --git a/Documentation/7.0/Raven.Documentation.Pages/ai-integration/images/add-vector-field-1.png b/Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/images/add-vector-field-1.png similarity index 100% rename from Documentation/7.0/Raven.Documentation.Pages/ai-integration/images/add-vector-field-1.png rename to Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/images/add-vector-field-1.png diff --git a/Documentation/7.0/Raven.Documentation.Pages/ai-integration/images/add-vector-field-2.png b/Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/images/add-vector-field-2.png similarity index 100% rename from Documentation/7.0/Raven.Documentation.Pages/ai-integration/images/add-vector-field-2.png rename to Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/images/add-vector-field-2.png diff --git a/Documentation/7.0/Raven.Documentation.Pages/ai-integration/images/json-document.png b/Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/images/json-document.png similarity index 100% rename from Documentation/7.0/Raven.Documentation.Pages/ai-integration/images/json-document.png rename to Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/images/json-document.png diff --git a/Documentation/7.0/Raven.Documentation.Pages/ai-integration/images/vector-search-1.png b/Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/images/vector-search-1.png similarity index 100% rename from Documentation/7.0/Raven.Documentation.Pages/ai-integration/images/vector-search-1.png rename to Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/images/vector-search-1.png diff --git a/Documentation/7.0/Raven.Documentation.Pages/ai-integration/images/vector-search-2.png b/Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/images/vector-search-2.png similarity index 100% rename from Documentation/7.0/Raven.Documentation.Pages/ai-integration/images/vector-search-2.png rename to Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/images/vector-search-2.png diff --git a/Documentation/7.0/Raven.Documentation.Pages/ai-integration/indexing-attachments-for-vector-search.dotnet.markdown b/Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/indexing-attachments-for-vector-search.dotnet.markdown similarity index 62% rename from Documentation/7.0/Raven.Documentation.Pages/ai-integration/indexing-attachments-for-vector-search.dotnet.markdown rename to Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/indexing-attachments-for-vector-search.dotnet.markdown index 62f4cd87e..af6e272e3 100644 --- a/Documentation/7.0/Raven.Documentation.Pages/ai-integration/indexing-attachments-for-vector-search.dotnet.markdown +++ b/Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/indexing-attachments-for-vector-search.dotnet.markdown @@ -4,18 +4,18 @@ {NOTE: } * This article explains how to index attachments using a **static-index** to enable vector search on their content. - Note: Vector search on attachment content is not available when making a [dynamic query](../ai-integration/vector-search-using-dynamic-query). + Note: Vector search on attachment content is not available when making a [dynamic query](../../ai-integration/vector-search/vector-search-using-dynamic-query). -* **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 +* **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 indexing a vector field. * In this page: - * [Overview](../ai-integration/indexing-attachments-for-vector-search#overview) - * [Indexing TEXT attachments](../ai-integration/indexing-attachments-for-vector-search#indexing-text-attachments) - * [Indexing NUMERICAL attachments](../ai-integration/indexing-attachments-for-vector-search#indexing-numerical-attachments) - * [LINQ index](../ai-integration/indexing-attachments-for-vector-search#linq-index) - * [JS index](../ai-integration/indexing-attachments-for-vector-search#js-index) - * [Indexing ALL attachments](../ai-integration/indexing-attachments-for-vector-search#indexing-all-attachments) + * [Overview](../../ai-integration/vector-search/indexing-attachments-for-vector-search#overview) + * [Indexing TEXT attachments](../../ai-integration/vector-search/indexing-attachments-for-vector-search#indexing-text-attachments) + * [Indexing NUMERICAL attachments](../../ai-integration/vector-search/indexing-attachments-for-vector-search#indexing-numerical-attachments) + * [LINQ index](../../ai-integration/vector-search/indexing-attachments-for-vector-search#linq-index) + * [JS index](../../ai-integration/vector-search/indexing-attachments-for-vector-search#js-index) + * [Indexing ALL attachments](../../ai-integration/vector-search/indexing-attachments-for-vector-search#indexing-all-attachments) {NOTE/} @@ -36,7 +36,7 @@ They are stored as **binary data**, regardless of content type. * Attachments are handled as streams, allowing efficient upload and retrieval. - Learn more in: [What are attachments](../document-extensions/attachments/what-are-attachments). + Learn more in: [What are attachments](../../document-extensions/attachments/what-are-attachments). {CONTENT-FRAME/} {CONTENT-FRAME: } @@ -55,7 +55,7 @@ enabling vector search on text or numerical data that is stored in the attachmen * **Attachments with NUMERICAL data**: * While attachments can store any file type, RavenDB does Not generate embeddings from images, videos, or other non-textual content. Each attachment must contain a **single** precomputed embedding vector, generated externally. - * RavenDB indexes the embedding vector from the attachment in and can apply [quantization](../ai-integration/vector-search-using-dynamic-query#quantization-options) + * RavenDB indexes the embedding vector from the attachment in and can apply [quantization](../../ai-integration/vector-search/vector-search-using-dynamic-query#quantization-options) (e.g., index it in _Int8_ format) if this is configured. * 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. 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 This applies to all _Company_ documents that contain an attachment with that name. {CODE-TABS} -{CODE-TAB:csharp:LINQ_index index_1@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:JS_index index_2@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:IndexDefinition index_3@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:Storing_text_attachments store_attachments_1@AiIntegration\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:LINQ_index index_1@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:JS_index index_2@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:IndexDefinition index_3@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:Storing_text_attachments store_attachments_1@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} {CODE-TABS/} Execute a vector search using the index: Results will include _Company_ documents whose attachment contains text similar to `"chinese food"`. {CODE-TABS} -{CODE-TAB:csharp:Query query_1@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:Query_async query_1_async@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:DocumentQuery query_2@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:DocumentQuery_async query_2_async@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:RawQuery query_3@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:RawQuery_async query_3_async@AiIntegration\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:Query query_1@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:Query_async query_1_async@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:DocumentQuery query_2@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:DocumentQuery_async query_2_async@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:RawQuery query_3@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:RawQuery_async query_3_async@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} {CODE-TAB-BLOCK:sql:RQL} from index "Companies/ByVector/FromTextAttachment" where vector.search(VectorFromAttachment, $searchTerm, 0.8) @@ -96,7 +96,7 @@ where vector.search(VectorFromAttachment, $searchTerm, 0.8) You can now extract the text from the attachments of the resulting documents: -{CODE:csharp extract_attachment_content@AiIntegration\VectorSearchWithAttachments.cs /} +{CODE:csharp extract_attachment_content@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} {PANEL/} @@ -112,21 +112,21 @@ You can now extract the text from the attachments of the resulting documents: * Each attachment contains raw numerical data in 32-bit floating-point format. {CODE-TABS} -{CODE-TAB:csharp:LINQ_index index_4@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:IndexDefinition index_5@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:Storing_numerical_attachments store_attachments_2@AiIntegration\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:LINQ_index index_4@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:IndexDefinition index_5@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:Storing_numerical_attachments store_attachments_2@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} {CODE-TABS/} Execute a vector search using the index: Results will include _Company_ documents whose attachment contains vectors similar to the query vector. {CODE-TABS} -{CODE-TAB:csharp:Query query_4@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:Query_async query_4_async@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:DocumentQuery query_5@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:DocumentQuery_async query_5_async@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:RawQuery query_6@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:RawQuery_async query_6_async@AiIntegration\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:Query query_4@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:Query_async query_4_async@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:DocumentQuery query_5@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:DocumentQuery_async query_5_async@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:RawQuery query_6@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:RawQuery_async query_6_async@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} {CODE-TAB-BLOCK:sql:RQL} from index "Companies/ByVector/FromNumericalAttachment" where vector.search(VectorFromAttachment, $queryVector) @@ -138,23 +138,23 @@ where vector.search(VectorFromAttachment, $queryVector) ### JS index -* The following is the JavaScript index format equivalent to the [LINQ index](../ai-integration/indexing-attachments-for-vector-search#linq-index) shown above. +* 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. * The main difference is that JavaScript indexes do Not support `getContentAsStream()` on attachment objects: * Because of this, embedding vectors must be stored in attachments as **Base64-encoded strings**. * Use `getContentAsString()` to retrieve the attachment content as a string, as shown in this example. {CODE-TABS} -{CODE-TAB:csharp:JS_index index_6@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:Storing_numerical_attachments_as_base64 store_attachments_3@AiIntegration\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:JS_index index_6@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:Storing_numerical_attachments_as_base64 store_attachments_3@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} {CODE-TABS/} Execute a vector search using the index: Results will include _Company_ documents whose attachment contains vectors similar to the query vector. {CODE-TABS} -{CODE-TAB:csharp:RawQuery query_7@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:RawQuery_async query_7_async@AiIntegration\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:RawQuery query_7@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:RawQuery_async query_7_async@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} {CODE-TAB-BLOCK:sql:RQL} from index "Companies/ByVector/FromNumericalAttachment/JS" where vector.search(VectorFromAttachment, $queryVector) @@ -171,21 +171,21 @@ where vector.search(VectorFromAttachment, $queryVector) * It indexes embeddings generated from the numerical data stored in ALL attachments of all _Company_ documents. {CODE-TABS} -{CODE-TAB:csharp:LINQ_index index_7@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:IndexDefinition index_8@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:Storing_numerical_attachments store_attachments_4@AiIntegration\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:LINQ_index index_7@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:IndexDefinition index_8@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:Storing_numerical_attachments store_attachments_4@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} {CODE-TABS/} Execute a vector search using the index: Results will include Company documents whose attachments contains vectors similar to the query vector. {CODE-TABS} -{CODE-TAB:csharp:Query query_8@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:Query_async query_8_async@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:DocumentQuery query_9@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:DocumentQuery_async query_9_async@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:RawQuery query_10@AiIntegration\VectorSearchWithAttachments.cs /} -{CODE-TAB:csharp:RawQuery_async query_10_async@AiIntegration\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:Query query_8@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:Query_async query_8_async@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:DocumentQuery query_9@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:DocumentQuery_async query_9_async@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:RawQuery query_10@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} +{CODE-TAB:csharp:RawQuery_async query_10_async@AiIntegration\VectorSearch\VectorSearchWithAttachments.cs /} {CODE-TAB-BLOCK:sql:RQL} from index "Companies/ByVector/AllAttachments" where vector.search(VectorFromAttachment, $queryVector) @@ -199,11 +199,11 @@ where vector.search(VectorFromAttachment, $queryVector) ### Vector Search -- [RavenDB as a vector database](../ai-integration/ravendb-as-vector-database) -- [Vector search using a dynamic query](../ai-integration/vector-search-using-dynamic-query) -- [Vector search using a static index](../ai-integration/vector-search-using-static-index) +- [RavenDB as a vector database](../../ai-integration/vector-search/ravendb-as-vector-database) +- [Vector search using a dynamic query](../../ai-integration/vector-search/vector-search-using-dynamic-query) +- [Vector search using a static index](../../ai-integration/vector-search/vector-search-using-static-index) ### Querying -- [Query overview](../client-api/session/querying/how-to-query) -- [Full-text search](../client-api/session/querying/text-search/full-text-search) +- [Query overview](../../client-api/session/querying/how-to-query) +- [Full-text search](../../client-api/session/querying/text-search/full-text-search) diff --git a/Documentation/7.0/Raven.Documentation.Pages/ai-integration/ravendb-as-vector-database.markdown b/Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/ravendb-as-vector-database.markdown similarity index 76% rename from Documentation/7.0/Raven.Documentation.Pages/ai-integration/ravendb-as-vector-database.markdown rename to Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/ravendb-as-vector-database.markdown index cc640b463..48409e225 100644 --- a/Documentation/7.0/Raven.Documentation.Pages/ai-integration/ravendb-as-vector-database.markdown +++ b/Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/ravendb-as-vector-database.markdown @@ -4,8 +4,8 @@ {NOTE: } * In this page: - * [What is a vector database](../ai-integration/ravendb-as-vector-database#what-is-a-vector-database) - * [Why choose RavenDB as your vector database](../ai-integration/ravendb-as-vector-database#why-choose-ravendb-as-your-vector-database) + * [What is a vector database](../../ai-integration/vector-search/ravendb-as-vector-database#what-is-a-vector-database) + * [Why choose RavenDB as your vector database](../../ai-integration/vector-search/ravendb-as-vector-database#why-choose-ravendb-as-your-vector-database) {NOTE/} @@ -32,7 +32,7 @@ Words, phrases, entire documents, images, audio, and other types of data can all be vectorized. * The raw data is converted into embeddings using [transformers](https://huggingface.co/docs/transformers). - To optimize storage and computation, transformers can encode embeddings with lower-precision data types, such as 8-bit integers, through a technique called [quantization](../ai-integration/vector-search-using-dynamic-query#quantization-options). + To optimize storage and computation, transformers can encode embeddings with lower-precision data types, such as 8-bit integers, through a technique called [quantization](../../ai-integration/vector-search/vector-search-using-dynamic-query#quantization-options). **Indexing embeddings and searching**: @@ -71,9 +71,9 @@ * An index can consist of multiple index-fields, each having a distinct type, such as a standard field, a spatial field, a full-text search field, or a **vector field**. This flexibility allows you to work with complex documents containing various data types and retrieve meaningful insights by querying the index across all these fields. - An example is available in [Indexing multiple field types](../ai-integration/vector-search-using-static-index#indexing-multiple-field-types). + An example is available in [Indexing multiple field types](../../ai-integration/vector-search/vector-search-using-static-index#indexing-multiple-field-types). -* Document [attachments](../ai-integration/indexing-attachments-for-vector-search) can also be indexed as vector fields, and Map-Reduce indexes can incorporate vector fields in their reduce phase, +* Document [attachments](../../ai-integration/vector-search/indexing-attachments-for-vector-search) can also be indexed as vector fields, and Map-Reduce indexes can incorporate vector fields in their reduce phase, further extending the versatility of your data processing and search capabilities. ##### Built-in embedding support: @@ -86,7 +86,7 @@ * **Numerical arrays input**: Documents in RavenDB can also contain numerical arrays with **pre-made embeddings** created elsewhere. - Use RavenDB's dedicated data type, [RavenVector](../ai-integration/data-types-for-vector-search#ravenvector), to store these embeddings in your document entities. + Use RavenDB's dedicated data type, [RavenVector](../../ai-integration/vector-search/data-types-for-vector-search#ravenvector), to store these embeddings in your document entities. This type is highly optimized to reduce storage space and enhance the speed of reading arrays from disk. * **HNSW algorithm usage**: @@ -95,7 +95,7 @@ * **Optimize storage via quantization**: RavenDB allows you to select the quantization format for the generated embeddings when creating the index. - Learn more in [Quantization options](../ai-integration/vector-search-using-dynamic-query#quantization-options). + Learn more in [Quantization options](../../ai-integration/vector-search/vector-search-using-dynamic-query#quantization-options). {PANEL/} @@ -103,15 +103,15 @@ ### Client API -- [RQL](../client-api/session/querying/what-is-rql) -- [Query overview](../client-api/session/querying/how-to-query) +- [RQL](../../client-api/session/querying/what-is-rql) +- [Query overview](../../client-api/session/querying/how-to-query) ### Vector Search -- [Vector search using a dynamic query](../ai-integration/vector-search-using-dynamic-query.markdown) -- [Vector search using a static index](../ai-integration/vector-search-using-static-index.markdown) -- [Data types for vector search](../ai-integration/data-tuypes-for-vector-search) +- [Vector search using a dynamic query](../../ai-integration/vector-search/vector-search-using-dynamic-query.markdown) +- [Vector search using a static index](../../ai-integration/vector-search/vector-search-using-static-index.markdown) +- [Data types for vector search](../../ai-integration/vector-search/data-types-for-vector-search) ### Server -- [indexing configuration](../server/configuration/indexing-configuration) +- [indexing configuration](../../server/configuration/indexing-configuration) diff --git a/Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search-using-dynamic-query.dotnet.markdown b/Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/vector-search-using-dynamic-query.dotnet.markdown similarity index 75% rename from Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search-using-dynamic-query.dotnet.markdown rename to Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/vector-search-using-dynamic-query.dotnet.markdown index a6a8a2f6b..b26737dc7 100644 --- a/Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search-using-dynamic-query.dotnet.markdown +++ b/Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/vector-search-using-dynamic-query.dotnet.markdown @@ -4,21 +4,21 @@ {NOTE: } * This article explains how to run a vector search using a **dynamic query**. - To learn how to run a vector search using a static-index, see [vector search using a static-index](../ai-integration/vector-search-using-static-index). + To learn how to run a vector search using a static-index, see [vector search using a static-index](../../ai-integration/vector-search/vector-search-using-static-index). * In this page: - * [What is a vector search](../ai-integration/vector-search-using-dynamic-query#what-is-a-vector-search) - * [Dynamic vector search query - Overview](../ai-integration/vector-search-using-dynamic-query#dynamic-vector-search-query---overview) - * [Creating embeddings for the auto-index](../ai-integration/vector-search-using-dynamic-query#creating-embeddings-for-the-auto-index) - * [Retrieving results](../ai-integration/vector-search-using-dynamic-query#retrieving-results) - * [The dynamic query parameters](../ai-integration/vector-search-using-dynamic-query#the-dynamic-query-parameters) - * [Corax auto-indexes](../ai-integration/vector-search-using-dynamic-query#corax-auto-indexes) - * [Vector search on TEXT](../ai-integration/vector-search-using-dynamic-query#vector-search-on-text) - * [Vector search on NUMERICAL content](../ai-integration/vector-search-using-dynamic-query#vector-search-on-numerical-content) - * [Exact search](../ai-integration/vector-search-using-dynamic-query#exact-search) - * [Quantization options](../ai-integration/vector-search-using-dynamic-query#quantization-options) - * [Querying vector fields and regular data in the same query](../ai-integration/vector-search-using-dynamic-query#querying-vector-fields-and-regular-data-in-the-same-query) - * [Syntax](../ai-integration/vector-search-using-dynamic-query#syntax) + * [What is a vector search](../../ai-integration/vector-search/vector-search-using-dynamic-query#what-is-a-vector-search) + * [Dynamic vector search query - Overview](../../ai-integration/vector-search/vector-search-using-dynamic-query#dynamic-vector-search-query---overview) + * [Creating embeddings for the auto-index](../../ai-integration/vector-search/vector-search-using-dynamic-query#creating-embeddings-for-the-auto-index) + * [Retrieving results](../../ai-integration/vector-search/vector-search-using-dynamic-query#retrieving-results) + * [The dynamic query parameters](../../ai-integration/vector-search/vector-search-using-dynamic-query#the-dynamic-query-parameters) + * [Corax auto-indexes](../../ai-integration/vector-search/vector-search-using-dynamic-query#corax-auto-indexes) + * [Vector search on TEXT](../../ai-integration/vector-search/vector-search-using-dynamic-query#vector-search-on-text) + * [Vector search on NUMERICAL content](../../ai-integration/vector-search/vector-search-using-dynamic-query#vector-search-on-numerical-content) + * [Exact search](../../ai-integration/vector-search/vector-search-using-dynamic-query#exact-search) + * [Quantization options](../../ai-integration/vector-search/vector-search-using-dynamic-query#quantization-options) + * [Querying vector fields and regular data in the same query](../../ai-integration/vector-search/vector-search-using-dynamic-query#querying-vector-fields-and-regular-data-in-the-same-query) + * [Syntax](../../ai-integration/vector-search/vector-search-using-dynamic-query#syntax) {NOTE/} @@ -40,11 +40,11 @@ * From the Client API - use method `VectorSearch()`, examples are provided later in this article * In RQL - use method `vector.search()` -* The **source data types** that can be used for vector search are detailed in [Data types for vector search](../ai-integration/data-types-for-vector-search). +* The **source data types** that can be used for vector search are detailed in [Data types for vector search](../../ai-integration/vector-search/data-types-for-vector-search). -* Note: Vector search queries cannot be used with [subscription queries](../client-api/data-subscriptions/creation/api-overview#subscription-query). +* Note: Vector search queries cannot be used with [subscription queries](../../client-api/data-subscriptions/creation/api-overview#subscription-query). -* When executing a dynamic vector search query, RavenDB creates a [Corax auto-index](.././ai-integration/vector-search-using-dynamic-query#corax-auto-indexes) to process the query, +* When executing a dynamic vector search query, RavenDB creates a [Corax auto-index](../../ai-integration/vector-search/vector-search-using-dynamic-query#corax-auto-indexes) to process the query, and the results are retrieved from that index. --- @@ -66,12 +66,12 @@ To avoid index errors, ensure that the dimensionality of these numerical arrays (i.e., their length) is consistent across all your source documents for the field you are querying. If you wish to enforce such consistency - - perform a vector search using a [static-index](../ai-integration/vector-search-using-static-index) instead of a dynamic query. + perform a vector search using a [static-index](../../ai-integration/vector-search/vector-search-using-static-index) instead of a dynamic query. {WARNING/} * **Quantizing the embeddings**: The embeddings are quantized based on the parameters specified in the query. - Learn more about quantization in [Quantization options](../ai-integration/vector-search-using-dynamic-query#quantization-options). + Learn more about quantization in [Quantization options](../../ai-integration/vector-search/vector-search-using-dynamic-query#quantization-options). * **Indexing the embeddings**: RavenDB indexes the embeddings on the server using the [HNSW algorithm](https://en.wikipedia.org/wiki/Hierarchical_navigable_small_world). @@ -87,13 +87,13 @@ * **Processing the query**: To ensure consistent comparisons, the **search term** is transformed into an embedding vector using the same method as the document fields. The server will search for the most similar vectors in the indexed vector space, - taking into account all the [query parameters](../ai-integration/vector-search-using-dynamic-query#the-dynamic-query-parameters) described below. + taking into account all the [query parameters](../../ai-integration/vector-search/vector-search-using-dynamic-query#the-dynamic-query-parameters) described below. The documents that correspond to the resulting vectors are then returned to the client. * **Search results**: By default, the resulting documents will be ordered by their score. - You can modify this behavior using the [Indexing.Corax.VectorSearch.OrderByScoreAutomatically](../server/configuration/indexing-configuration#indexing.corax.vectorsearch.orderbyscoreautomatically) configuration key. - In addition, you can apply any of the 'order by' methods to your query, as explained in [sort query results](../client-api/session/querying/sort-query-results). + You can modify this behavior using the [Indexing.Corax.VectorSearch.OrderByScoreAutomatically](../../server/configuration/indexing-configuration#indexing.corax.vectorsearch.orderbyscoreautomatically) configuration key. + In addition, you can apply any of the 'order by' methods to your query, as explained in [sort query results](../../client-api/session/querying/sort-query-results). {CONTENT-FRAME/} {CONTENT-FRAME: } @@ -107,7 +107,7 @@ * **Target quantization** You can specify the quantization encoding for the embeddings that will be created from source data. - Learn more about quantization in [Quantization options](../ai-integration/vector-search-using-dynamic-query#quantization-options). + Learn more about quantization in [Quantization options](../../ai-integration/vector-search/vector-search-using-dynamic-query#quantization-options). * **Minimum similarity** You can specify the minimum similarity to use when searching for related vectors. @@ -116,7 +116,7 @@ while a value closer to `0.0f` allows for less similarity. If not specified, the default value is taken from the following configuration key: - [Indexing.Corax.VectorSearch.DefaultMinimumSimilarity ](../server/configuration/indexing-configuration#indexing.corax.vectorsearch.defaultnumberofcandidatesforquerying). + [Indexing.Corax.VectorSearch.DefaultMinimumSimilarity ](../../server/configuration/indexing-configuration#indexing.corax.vectorsearch.defaultnumberofcandidatesforquerying). * **Number of candidates** You can specify the maximum number of vectors that RavenDB will return from a graph search. @@ -125,7 +125,7 @@ * higher than the number of candidates - when the same vector is shared between multiple documents. If not specified, the default value is taken from the following configuration key: - [Indexing.Corax.VectorSearch.DefaultNumberOfCandidatesForQuerying](../server/configuration/indexing-configuration#indexing.corax.vectorsearch.defaultminimumsimilarity). + [Indexing.Corax.VectorSearch.DefaultNumberOfCandidatesForQuerying](../../server/configuration/indexing-configuration#indexing.corax.vectorsearch.defaultminimumsimilarity). * **Search method** * _Approximate Nearest-Neighbor search_ (Default): @@ -133,7 +133,7 @@ * _Exact search_: Perform a thorough scan of the vectors to find the actual closest vectors, offering better accuracy but at a higher computational cost. - Learn more in [Exact search](../ai-integration/vector-search-using-dynamic-query#exact-search). + Learn more in [Exact search](../../ai-integration/vector-search/vector-search-using-dynamic-query#exact-search). {CONTENT-FRAME/} {CONTENT-FRAME: } @@ -141,12 +141,12 @@ #### Corax auto-indexes --- -* Only [Corax indexes](../indexes/search-engine/corax) support vector search. +* Only [Corax indexes](../../indexes/search-engine/corax) support vector search. -* Even if your **default auto-index engine** is set to Lucene (via [Indexing.Auto.SearchEngineType](../server/configuration/indexing-configuration#indexing.auto.searchenginetype)), +* Even if your **default auto-index engine** is set to Lucene (via [Indexing.Auto.SearchEngineType](../../server/configuration/indexing-configuration#indexing.auto.searchenginetype)), performing a vector search using a dynamic query will create a new auto-index based on Corax. -* Normally, new dynamic queries extend existing [auto-indexes](../client-api/session/querying/how-to-query#queries-always-provide-results-using-an-index) if they require additional fields. +* Normally, new dynamic queries extend existing [auto-indexes](../../client-api/session/querying/how-to-query#queries-always-provide-results-using-an-index) if they require additional fields. However, a dynamic query with a vector search will not extend an existing Lucene-based auto-index. {NOTE: } @@ -172,15 +172,15 @@ * Since this query does not specify a target quantization format, the generated embedding vectors will be encoded in the default _Single_ format (single-precision floating-point). - Refer to [Quantization options](../ai-integration/vector-search-using-dynamic-query#quantization-options) for examples that specify the destination quantization. + Refer to [Quantization options](../../ai-integration/vector-search/vector-search-using-dynamic-query#quantization-options) for examples that specify the destination quantization. {CODE-TABS} - {CODE-TAB:csharp:Query vs_1@AiIntegration\VectorSearchUsingDynamicQuery.cs /} - {CODE-TAB:csharp:Query_async vs_1_async@AiIntegration\VectorSearchUsingDynamicQuery.cs /} - {CODE-TAB:csharp:DocumentQuery vs_2@AiIntegration\VectorSearchUsingDynamicQuery.cs /} - {CODE-TAB:csharp:DocumentQuery_async vs_2_async@AiIntegration\VectorSearchUsingDynamicQuery.cs /} - {CODE-TAB:csharp:RawQuery vs_3@AiIntegration\VectorSearchUsingDynamicQuery.cs /} - {CODE-TAB:csharp:RawQuery_async vs_3_async@AiIntegration\VectorSearchUsingDynamicQuery.cs /} + {CODE-TAB:csharp:Query vs_1@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} + {CODE-TAB:csharp:Query_async vs_1_async@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} + {CODE-TAB:csharp:DocumentQuery vs_2@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} + {CODE-TAB:csharp:DocumentQuery_async vs_2_async@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} + {CODE-TAB:csharp:RawQuery vs_3@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} + {CODE-TAB:csharp:RawQuery_async vs_3_async@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} {CODE-TAB-BLOCK:sql:RQL} // Query the Products collection from "Products" @@ -207,26 +207,26 @@ where vector.search(embedding.text(Name), "italian food", 0.82, 20) The _Movie_ class includes various formats of numerical vector data. Note: This sample data is minimal to keep the examples simple. -* Note the usage of RavenDB's dedicated data type, [RavenVector](../ai-integration/data-types-for-vector-search#ravenvector), which is highly optimized for reading and writing arrays to disk. - Learn more about the source data types suitable for vector search in [Data types for vector search](../ai-integration/data-types-for-vector-search). +* Note the usage of RavenDB's dedicated data type, [RavenVector](../../ai-integration/vector-search/data-types-for-vector-search#ravenvector), which is highly optimized for reading and writing arrays to disk. + Learn more about the source data types suitable for vector search in [Data types for vector search](../../ai-integration/vector-search/data-types-for-vector-search). * Unlike vector searches on text, where RavenDB transforms the raw text into an embedding vector, numerical vector searches require your source data to already be in an embedding vector format. * If your raw data is in a _float_ format, you can request further quantization of the embeddings that will be indexed in the auto-index. - See an example of this in: [Quantiztion options](../ai-integration/vector-search-using-dynamic-query#quantization-options). + See an example of this in: [Quantiztion options](../../ai-integration/vector-search/vector-search-using-dynamic-query#quantization-options). * Raw data that is already formatted as _Int8_ or _Binary_ **cannot** be quantized to lower-form (e.g. Int8 -> Int1). - 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). + 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). --- #### Sample data: {CODE-TABS} -{CODE-TAB:csharp:Class movie_class@AiIntegration\VectorSearchUsingDynamicQuery.cs /} -{CODE-TAB:csharp:Sample_data sample_data@AiIntegration\VectorSearchUsingDynamicQuery.cs /} -{CODE-TAB:csharp:Sample_document sample_document@AiIntegration\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:Class movie_class@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:Sample_data sample_data@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:Sample_document sample_document@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} {CODE-TABS/} --- @@ -241,12 +241,12 @@ These examples search for Movie documents with vectors similar to the one provid which contains numerical data in **floating-point format**. {CODE-TABS} -{CODE-TAB:csharp:Query vs_4@AiIntegration\VectorSearchUsingDynamicQuery.cs /} -{CODE-TAB:csharp:Query_async vs_4_async@AiIntegration\VectorSearchUsingDynamicQuery.cs /} -{CODE-TAB:csharp:DocumentQuery vs_5@AiIntegration\VectorSearchUsingDynamicQuery.cs /} -{CODE-TAB:csharp:DocumentQuery_async vs_5_async@AiIntegration\VectorSearchUsingDynamicQuery.cs /} -{CODE-TAB:csharp:RawQuery vs_6@AiIntegration\VectorSearchUsingDynamicQuery.cs /} -{CODE-TAB:csharp:RawQuery_async vs_6_async@AiIntegration\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:Query vs_4@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:Query_async vs_4_async@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:DocumentQuery vs_5@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:DocumentQuery_async vs_5_async@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:RawQuery vs_6@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:RawQuery_async vs_6_async@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} {CODE-TAB-BLOCK:sql:RQL} from "Movies" // The source document field type is interpreted as 'Single' by default @@ -262,7 +262,7 @@ where vector.search(TagsEmbeddedAsSingle, $queryVector, 0.85, 10) which contains numerical data that is already quantized in **_Int8_ format**. {CODE-TABS} -{CODE-TAB:csharp:Query vs_7@AiIntegration\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:Query vs_7@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} {CODE-TAB-BLOCK:sql:RQL} from "Movies" // Wrap the source document field name with 'embedding.i8' to indicate the source data type @@ -278,7 +278,7 @@ where vector.search(embedding.i8(TagsEmbeddedAsInt8), $queryVector) which contains numerical data represented in **_Base64_ format**. {CODE-TABS} -{CODE-TAB:csharp:Query vs_8@AiIntegration\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:Query vs_8@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} {CODE-TAB-BLOCK:sql:RQL} from "Movies" // * Wrap the source document field name using 'embedding.' to specify @@ -305,12 +305,12 @@ where vector.search(TagsEmbeddedAsBase64, $queryVectorBase64) Setting the param is similar for both text and numerical content searches. {CODE-TABS} - {CODE-TAB:csharp:Query vs_9@AiIntegration\VectorSearchUsingDynamicQuery.cs /} - {CODE-TAB:csharp:Query_async vs_9_async@AiIntegration\VectorSearchUsingDynamicQuery.cs /} - {CODE-TAB:csharp:DocumentQuery vs_10@AiIntegration\VectorSearchUsingDynamicQuery.cs /} - {CODE-TAB:csharp:DocumentQuery_async vs_10_async@AiIntegration\VectorSearchUsingDynamicQuery.cs /} - {CODE-TAB:csharp:RawQuery vs_11@AiIntegration\VectorSearchUsingDynamicQuery.cs /} - {CODE-TAB:csharp:RawQuery_async vs_11_async@AiIntegration\VectorSearchUsingDynamicQuery.cs /} + {CODE-TAB:csharp:Query vs_9@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} + {CODE-TAB:csharp:Query_async vs_9_async@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} + {CODE-TAB:csharp:DocumentQuery vs_10@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} + {CODE-TAB:csharp:DocumentQuery_async vs_10_async@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} + {CODE-TAB:csharp:RawQuery vs_11@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} + {CODE-TAB:csharp:RawQuery_async vs_11_async@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} {CODE-TAB-BLOCK:sql:RQL} from "Products" // Wrap the vector.search query with the 'exact()' method @@ -374,12 +374,12 @@ The available quantization options are: * The generated embeddings will use the _Int8_ format. {CODE-TABS} -{CODE-TAB:csharp:Query vs_15@AiIntegration\VectorSearchUsingDynamicQuery.cs /} -{CODE-TAB:csharp:Query_async vs_15_async@AiIntegration\VectorSearchUsingDynamicQuery.cs /} -{CODE-TAB:csharp:DocumentQuery vs_16@AiIntegration\VectorSearchUsingDynamicQuery.cs /} -{CODE-TAB:csharp:DocumentQuery_async vs_16_async@AiIntegration\VectorSearchUsingDynamicQuery.cs /} -{CODE-TAB:csharp:RawQuery vs_17@AiIntegration\VectorSearchUsingDynamicQuery.cs /} -{CODE-TAB:csharp:RawQuery_async vs_17_async@AiIntegration\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:Query vs_15@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:Query_async vs_15_async@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:DocumentQuery vs_16@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:DocumentQuery_async vs_16_async@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:RawQuery vs_17@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:RawQuery_async vs_17_async@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} {CODE-TAB-BLOCK:sql:RQL} from "Products" // Wrap the 'Name' field with 'embedding.text_i8' @@ -396,12 +396,12 @@ where vector.search(embedding.text_i8(Name), $searchTerm) * The generated embeddings will use the _Binary_ format. {CODE-TABS} -{CODE-TAB:csharp:Query vs_18@AiIntegration\VectorSearchUsingDynamicQuery.cs /} -{CODE-TAB:csharp:Query_async vs_18_async@AiIntegration\VectorSearchUsingDynamicQuery.cs /} -{CODE-TAB:csharp:DocumentQuery vs_19@AiIntegration\VectorSearchUsingDynamicQuery.cs /} -{CODE-TAB:csharp:DocumentQuery_async vs_19_async@AiIntegration\VectorSearchUsingDynamicQuery.cs /} -{CODE-TAB:csharp:RawQuery vs_20@AiIntegration\VectorSearchUsingDynamicQuery.cs /} -{CODE-TAB:csharp:RawQuery_async vs_20_async@AiIntegration\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:Query vs_18@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:Query_async vs_18_async@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:DocumentQuery vs_19@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:DocumentQuery_async vs_19_async@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:RawQuery vs_20@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} +{CODE-TAB:csharp:RawQuery_async vs_20_async@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} {CODE-TAB-BLOCK:sql:RQL} from "Movies" // Wrap the 'TagsEmbeddedAsSingle' field with 'embedding.f32_i1' @@ -484,12 +484,12 @@ where vector.search(TagsEmbeddedAsSingle, $queryVector, 0.85, 10) `Auto/Products/ByPricePerUnitAndVector.search(embedding.text(Name))`. {CODE-TABS} - {CODE-TAB:csharp:Query vs_12@AiIntegration\VectorSearchUsingDynamicQuery.cs /} - {CODE-TAB:csharp:Query_async vs_12_async@AiIntegration\VectorSearchUsingDynamicQuery.cs /} - {CODE-TAB:csharp:DocumentQuery vs_13@AiIntegration\VectorSearchUsingDynamicQuery.cs /} - {CODE-TAB:csharp:DocumentQuery_async vs_13_async@AiIntegration\VectorSearchUsingDynamicQuery.cs /} - {CODE-TAB:csharp:RawQuery vs_14@AiIntegration\VectorSearchUsingDynamicQuery.cs /} - {CODE-TAB:csharp:RawQuery_async vs_14_async@AiIntegration\VectorSearchUsingDynamicQuery.cs /} + {CODE-TAB:csharp:Query vs_12@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} + {CODE-TAB:csharp:Query_async vs_12_async@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} + {CODE-TAB:csharp:DocumentQuery vs_13@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} + {CODE-TAB:csharp:DocumentQuery_async vs_13_async@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} + {CODE-TAB:csharp:RawQuery vs_14@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} + {CODE-TAB:csharp:RawQuery_async vs_14_async@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} {CODE-TAB-BLOCK:sql:RQL} from "Products" // The filtering condition: @@ -535,7 +535,7 @@ and (vector.search(embedding.text(Name), $searchTerm, null, 25)) `VectorSearch`: -{CODE:csharp syntax_1@AiIntegration\VectorSearchUsingDynamicQuery.cs /} +{CODE:csharp syntax_1@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} | Parameter | Type | Description | |---------------------------|--------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------| @@ -548,16 +548,16 @@ and (vector.search(embedding.text(Name), $searchTerm, null, 25)) The default value for `minimumSimilarity` is defined by this configuration key: -[Indexing.Corax.VectorSearch.DefaultMinimumSimilarity ](../server/configuration/indexing-configuration#indexing.corax.vectorsearch.defaultnumberofcandidatesforquerying). +[Indexing.Corax.VectorSearch.DefaultMinimumSimilarity ](../../server/configuration/indexing-configuration#indexing.corax.vectorsearch.defaultnumberofcandidatesforquerying). The default value for `numberOfCandidates` is defined by this configuration key: -[Indexing.Corax.VectorSearch.DefaultNumberOfCandidatesForQuerying](../server/configuration/indexing-configuration#indexing.corax.vectorsearch.defaultminimumsimilarity). +[Indexing.Corax.VectorSearch.DefaultNumberOfCandidatesForQuerying](../../server/configuration/indexing-configuration#indexing.corax.vectorsearch.defaultminimumsimilarity). --- `IVectorFieldFactory`: -{CODE:csharp syntax_2@AiIntegration\VectorSearchUsingDynamicQuery.cs /} +{CODE:csharp syntax_2@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} | Parameter | Type | Description | |---------------------------------|-------------------------------|----------------------------------------------------------------------------------------| @@ -571,27 +571,27 @@ The default value for `numberOfCandidates` is defined by this configuration key: `IVectorEmbeddingTextField`: -{CODE:csharp syntax_3@AiIntegration\VectorSearchUsingDynamicQuery.cs /} +{CODE:csharp syntax_3@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} | Parameter | Type | Description | |---------------------------------|-----------------------|-----------------------------------------| | **targetEmbeddingQuantization** | `VectorEmbeddingType` | The desired target quantization format. | -{CODE:csharp syntax_4@AiIntegration\VectorSearchUsingDynamicQuery.cs /} +{CODE:csharp syntax_4@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} --- `IVectorEmbeddingTextFieldValueFactory`: -{CODE:csharp syntax_5@AiIntegration\VectorSearchUsingDynamicQuery.cs /} +{CODE:csharp syntax_5@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} --- #### `RavenVector`: RavenVector is RavenDB's dedicated data type for storing and querying numerical embeddings. -Learn more in [RavenVector](../ai-integration/data-types-for-vector-search#ravenvector) +Learn more in [RavenVector](../../ai-integration/vector-search/data-types-for-vector-search#ravenvector) -{CODE:csharp syntax_6@AiIntegration\VectorSearchUsingDynamicQuery.cs /} +{CODE:csharp syntax_6@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} --- @@ -600,7 +600,7 @@ RavenDB provides the following quantizer methods. Use them to transform your raw data to the desired format. Other quantizers may not be compatible. -{CODE:csharp syntax_7@AiIntegration\VectorSearchUsingDynamicQuery.cs /} +{CODE:csharp syntax_7@AiIntegration\VectorSearch\VectorSearchUsingDynamicQuery.cs /} {PANEL/} @@ -608,11 +608,11 @@ Other quantizers may not be compatible. ### Vector Search -- [RavenDB as a vector database](../ai-integration/ravendb-as-vector-database) -- [Vector search using a static index](../ai-integration/vector-search-using-static-index) -- [Data types for vector search](../ai-integration/data-tuypes-for-vector-search) +- [RavenDB as a vector database](../../ai-integration/vector-search/ravendb-as-vector-database) +- [Vector search using a static index](../../ai-integration/vector-search/vector-search-using-static-index) +- [Data types for vector search](../../ai-integration/vector-search/data-types-for-vector-search) ### Querying -- [Query overview](../client-api/session/querying/how-to-query) -- [Full-text search](../client-api/session/querying/text-search/full-text-search) +- [Query overview](../../client-api/session/querying/how-to-query) +- [Full-text search](../../client-api/session/querying/text-search/full-text-search) diff --git a/Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search-using-static-index.dotnet.markdown b/Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/vector-search-using-static-index.dotnet.markdown similarity index 63% rename from Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search-using-static-index.dotnet.markdown rename to Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/vector-search-using-static-index.dotnet.markdown index 3e83ccf3b..f067894b0 100644 --- a/Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search-using-static-index.dotnet.markdown +++ b/Documentation/7.0/Raven.Documentation.Pages/ai-integration/vector-search/vector-search-using-static-index.dotnet.markdown @@ -4,23 +4,23 @@ {NOTE: } * This article explains how to perform a **vector search** using a **static index**. - **Prior to this article**, it is recommended to get familiar with the [Vector search using a dynamic query](../ai-integration/vector-search-using-dynamic-query) article. + **Prior to this article**, it is recommended to get familiar with the [Vector search using a dynamic query](../../ai-integration/vector-search/vector-search-using-dynamic-query) article. * A static index allows you to define a **vector index-field**, enabling you to execute vector searches - while leveraging the advantages of RavenDB's [indexes](../indexes/what-are-indexes). + while leveraging the advantages of RavenDB's [indexes](../../indexes/what-are-indexes). -* The vector search feature is only supported by indexes that use the [Corax search engine](../indexes/search-engine/corax). +* The vector search feature is only supported by indexes that use the [Corax search engine](../../indexes/search-engine/corax). * In this page: - * [Indexing a vector field - Overview](../ai-integration/vector-search-using-static-index#indexing-a-vector-field---overview) - * [Parameters defined at index definition](../ai-integration/vector-search-using-static-index#parameters-defined-at-index-definition) - * [Behavior during indexing](../ai-integration/vector-search-using-static-index#behavior-during-indexing) - * [Parameters used at query time](../ai-integration/vector-search-using-static-index#parameters-used-at-query-time) - * [Behavior when documents are deleted](../ai-integration/vector-search-using-static-index#vector-behavior-when-documents-are-deleted) - * [Indexing vector data - TEXT](../ai-integration/vector-search-using-static-index#indexing-vector-data---text) - * [Indexing vector data - NUMERICAL](../ai-integration/vector-search-using-static-index#indexing-vector-data---numerical) - * [Indexing multiple field types](../ai-integration/vector-search-using-static-index#indexing-multiple-field-types) - * [Define a vector field in the Studio](../ai-integration/vector-search-using-static-index#define-a-vector-field-in-the-studio) + * [Indexing a vector field - Overview](../../ai-integration/vector-search/vector-search/vector-search-using-static-index#indexing-a-vector-field---overview) + * [Parameters defined at index definition](../../ai-integration/vector-search/vector-search-using-static-index#parameters-defined-at-index-definition) + * [Behavior during indexing](../../ai-integration/vector-search/vector-search-using-static-index#behavior-during-indexing) + * [Parameters used at query time](../../ai-integration/vector-search/vector-search-using-static-index#parameters-used-at-query-time) + * [Behavior when documents are deleted](../../ai-integration/vector-search/vector-search-using-static-index#vector-behavior-when-documents-are-deleted) + * [Indexing vector data - TEXT](../../ai-integration/vector-search/vector-search-using-static-index#indexing-vector-data---text) + * [Indexing vector data - NUMERICAL](../../ai-integration/vector-search/vector-search-using-static-index#indexing-vector-data---numerical) + * [Indexing multiple field types](../../ai-integration/vector-search/vector-search-using-static-index#indexing-multiple-field-types) + * [Define a vector field in the Studio](../../ai-integration/vector-search/vector-search-using-static-index#define-a-vector-field-in-the-studio) {NOTE/} @@ -30,9 +30,9 @@ * To define a **vector index-field** in your static-index definition: * From the Client API - use method `CreateVector()`, examples are provided later in this article. - * From the Studio - see [Define a vector field in the Studio](../ai-integration/vector-search-using-static-index#define-a-vector-field-in-the-studio). + * From the Studio - see [Define a vector field in the Studio](../../ai-integration/vector-search/vector-search-using-static-index#define-a-vector-field-in-the-studio). -* The **source data types** that can be used for vector search is detailed in [Data types for vector search](../ai-integration/data-types-for-vector-search). +* The **source data types** that can be used for vector search is detailed in [Data types for vector search](../../ai-integration/vector-search/data-types-for-vector-search). {CONTENT-FRAME: } @@ -48,7 +48,7 @@ Options include `Text`, `Single`, `Int8`, or `Binary`. **Destination embedding type** - Specify the quantization format for the embeddings that will be generated. -Read more about quantization in [Quantization options](../ai-integration/vector-search-using-dynamic-query#quantization-options). +Read more about quantization in [Quantization options](../../ai-integration/vector-search/vector-search-using-dynamic-query#quantization-options). **Dimensions** - For numerical input only - define the size of the array from your source document. @@ -61,11 +61,11 @@ For numerical input only - define the size of the array from your source documen **Number of edges** - Specify the number of edges that will be created for a vector during indexing. -If not specified, the default value is taken from the following configuration key: [Indexing.Corax.VectorSearch.DefaultNumberOfEdges](../server/configuration/indexing-configuration#indexing.corax.vectorsearch.defaultnumberofedges). +If not specified, the default value is taken from the following configuration key: [Indexing.Corax.VectorSearch.DefaultNumberOfEdges](../../server/configuration/indexing-configuration#indexing.corax.vectorsearch.defaultnumberofedges). **Number of candidates for indexing time** - The number of candidates (potential neighboring vectors) that RavenDB evaluates during vector indexing. -If not specified, the default value is taken from the following configuration key: [Indexing.Corax.VectorSearch.DefaultNumberOfCandidatesForIndexing](../server/configuration/indexing-configuration#indexing.corax.vectorsearch.defaultnumberofcandidatesforindexing). +If not specified, the default value is taken from the following configuration key: [Indexing.Corax.VectorSearch.DefaultNumberOfCandidatesForIndexing](../../server/configuration/indexing-configuration#indexing.corax.vectorsearch.defaultnumberofcandidatesforindexing). (Note, this param differs from the number of candidates for query time). {CONTENT-FRAME/} @@ -94,7 +94,7 @@ enabling efficient retrieval of Approximate Nearest Neighbors (ANN) during queri **Minimum similarity** - You can specify the minimum similarity to use when searching for related vectors. Can be a value between `0.0f` and `1.0f`. A value closer to `1.0f` requires higher similarity between vectors, while a value closer to `0.0f` allows for less similarity. -If not specified, the default value is taken from the following configuration key: [Indexing.Corax.VectorSearch.DefaultMinimumSimilarity](../server/configuration/indexing-configuration#indexing.corax.vectorsearch.defaultminimumsimilarity). +If not specified, the default value is taken from the following configuration key: [Indexing.Corax.VectorSearch.DefaultMinimumSimilarity](../../server/configuration/indexing-configuration#indexing.corax.vectorsearch.defaultminimumsimilarity). **Number of candidates at query time** - You can specify the maximum number of vectors that RavenDB will return from a graph search. @@ -104,7 +104,7 @@ The number of the resulting documents that correspond to these vectors may be: * higher than the number of candidates - when the same vector is shared between multiple documents. -If not specified, the default value is taken from the following configuration key: [Indexing.Corax.VectorSearch.DefaultNumberOfCandidatesForQuerying](../server/configuration/indexing-configuration#indexing.corax.vectorsearch.defaultnumberofcandidatesforquerying). +If not specified, the default value is taken from the following configuration key: [Indexing.Corax.VectorSearch.DefaultNumberOfCandidatesForQuerying](../../server/configuration/indexing-configuration#indexing.corax.vectorsearch.defaultnumberofcandidatesforquerying). **Search method** - You can specify the search method at query time: @@ -126,8 +126,8 @@ The server will search for the most similar vectors in the indexed vector space, The documents that correspond to the resulting vectors are then returned to the client. By default, the resulting documents will be ordered by their score. -You can modify this behavior using the [Indexing.Corax.VectorSearch.OrderByScoreAutomatically](../server/configuration/indexing-configuration#indexing.corax.vectorsearch.orderbyscoreautomatically) configuration key. -In addition, you can apply any of the 'order by' methods to your query, as explained in [sort query results](../client-api/session/querying/sort-query-results). +You can modify this behavior using the [Indexing.Corax.VectorSearch.OrderByScoreAutomatically](../../server/configuration/indexing-configuration#indexing.corax.vectorsearch.orderbyscoreautomatically) configuration key. +In addition, you can apply any of the 'order by' methods to your query, as explained in [sort query results](../../client-api/session/querying/sort-query-results). {CONTENT-FRAME/} {CONTENT-FRAME: } @@ -150,21 +150,21 @@ The following index defines a **vector field** named `VectorfromText`. It indexes embeddings generated from the textual data in the `Name` field of all _Product_ documents. {CODE-TABS} -{CODE-TAB:csharp:LINQ_index index_1@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:JS_index index_2@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:IndexDefinition index_3@AiIntegration\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:LINQ_index index_1@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:JS_index index_2@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:IndexDefinition index_3@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} {CODE-TABS/} Execute a vector search using the index: Results will include _Product_ documents where the `Name` field is similar to the search term `"italian food"`. {CODE-TABS} -{CODE-TAB:csharp:Query query_1@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:Query_async query_1_async@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:DocumentQuery query_2@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:DocumentQuery_async query_2_async@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:RawQuery query_3@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:RawQuery_async query_3_async@AiIntegration\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:Query query_1@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:Query_async query_1_async@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:DocumentQuery query_2@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:DocumentQuery_async query_2_async@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:RawQuery query_3@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:RawQuery_async query_3_async@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} {CODE-TAB-BLOCK:sql:RQL} from index "Products/ByVector/Text" // Optionally, wrap the 'vector.search' query with 'exact()' to perform an exact search @@ -178,7 +178,7 @@ where exact(vector.search(VectorFromText, $searchTerm, 0.82, 20)) {PANEL: Indexing vector data - NUMERICAL} {NOTE: } -The examples in this section use the [sample data provided in the dynamic query article](../ai-integration/vector-search-using-dynamic-query#sample-data). +The examples in this section use the [sample data provided in the dynamic query article](../../ai-integration/vector-search/vector-search-using-dynamic-query#sample-data). {NOTE/} --- @@ -188,20 +188,20 @@ It indexes embeddings generated from the numerical data in the `TagsEmbeddedAsSi The raw numerical data in the source documents is in **32-bit floating-point format**. {CODE-TABS} -{CODE-TAB:csharp:LINQ_index index_4@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:JS_index index_5@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:IndexDefinition index_6@AiIntegration\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:LINQ_index index_4@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:JS_index index_5@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:IndexDefinition index_6@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} {CODE-TABS/} Execute a vector search using the index: {CODE-TABS} -{CODE-TAB:csharp:Query query_4@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:Query_async query_4_async@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:DocumentQuery query_5@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:DocumentQuery_async query_5_async@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:RawQuery query_6@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:RawQuery_async query_6_async@AiIntegration\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:Query query_4@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:Query_async query_4_async@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:DocumentQuery query_5@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:DocumentQuery_async query_5_async@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:RawQuery query_6@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:RawQuery_async query_6_async@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} {CODE-TAB-BLOCK:sql:RQL} from index "Movies/ByVector/Single" where vector.search(VectorFromSingle, $queryVector) @@ -216,20 +216,20 @@ It indexes embeddings generated from the numerical arrays in the `TagsEmbeddedAs The raw numerical data in the source documents is in **Int8 (8-bit integers) format**. {CODE-TABS} -{CODE-TAB:csharp:LINQ_index index_7@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:JS_index index_8@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:IndexDefinition index_9@AiIntegration\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:LINQ_index index_7@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:JS_index index_8@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:IndexDefinition index_9@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} {CODE-TABS/} Execute a vector search using the index: {CODE-TABS} -{CODE-TAB:csharp:Query query_7@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:Query_async query_7_async@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:DocumentQuery query_8@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:DocumentQuery_async query_8_async@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:RawQuery query_9@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:RawQuery_async query_9_async@AiIntegration\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:Query query_7@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:Query_async query_7_async@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:DocumentQuery query_8@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:DocumentQuery_async query_8_async@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:RawQuery query_9@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:RawQuery_async query_9_async@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} {CODE-TAB-BLOCK:sql:RQL} from index "Movies/ByVector/Int8" where vector.search(VectorFromInt8Arrays, $queryVector) @@ -242,22 +242,22 @@ where vector.search(VectorFromInt8Arrays, $queryVector) {PANEL: Indexing multiple field types} An index can define multiple types of index-fields. In this example, the index includes: -A _'regular'_ field, a _'vector'_ field, and a field configured for [full-text search](../indexes/querying/searching). +A _'regular'_ field, a _'vector'_ field, and a field configured for [full-text search](../../indexes/querying/searching). This allows you to query across all fields using various predicates. {CODE-TABS} -{CODE-TAB:csharp:LINQ_index index_10@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:JS_index index_11@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:IndexDefinition index_12@AiIntegration\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:LINQ_index index_10@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:JS_index index_11@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:IndexDefinition index_12@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} {CODE-TABS/} Execute a query that combines predicates across all index-field types: {CODE-TABS} -{CODE-TAB:csharp:DocumentQuery query_10@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:DocumentQuery_async query_10_async@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:RawQuery query_11@AiIntegration\VectorSearchUsingStaticIndex.cs /} -{CODE-TAB:csharp:RawQuery_async query_11_async@AiIntegration\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:DocumentQuery query_10@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:DocumentQuery_async query_10_async@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:RawQuery query_11@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} +{CODE-TAB:csharp:RawQuery_async query_11_async@AiIntegration\VectorSearch\VectorSearchUsingStaticIndex.cs /} {CODE-TAB-BLOCK:sql:RQL} from index "Products/ByMultipleFields" where PricePerUnit > $minPrice @@ -285,12 +285,12 @@ or vector.search(VectorFromText, $searchTerm2, 0.8) ### Vector Search -- [RavenDB as a vector database](../ai-integration/ravendb-as-vector-database) -- [Vector search using a dynamic query](../ai-integration/vector-search-using-dynamic-query) -- [Data types for vector search](../ai-integration/data-tuypes-for-vector-search) -- [Indexing attachment for vector search](../ai-integration/indexing-attachments-for-vector-search) +- [RavenDB as a vector database](../../ai-integration/vector-search/ravendb-as-vector-database) +- [Vector search using a dynamic query](../../ai-integration/vector-search/vector-search-using-dynamic-query) +- [Data types for vector search](../../ai-integration/vector-search/data-types-for-vector-search) +- [Indexing attachment for vector search](../../ai-integration/vector-search/indexing-attachments-for-vector-search) ### Querying -- [Query overview](../client-api/session/querying/how-to-query) -- [Full-text search](../client-api/session/querying/text-search/full-text-search) +- [Query overview](../../client-api/session/querying/how-to-query) +- [Full-text search](../../client-api/session/querying/text-search/full-text-search) diff --git a/Documentation/7.0/Samples/csharp/Raven.Documentation.Samples/AiIntegration/DataTypes.cs b/Documentation/7.0/Samples/csharp/Raven.Documentation.Samples/AiIntegration/VectorSearch/DataTypes.cs similarity index 100% rename from Documentation/7.0/Samples/csharp/Raven.Documentation.Samples/AiIntegration/DataTypes.cs rename to Documentation/7.0/Samples/csharp/Raven.Documentation.Samples/AiIntegration/VectorSearch/DataTypes.cs diff --git a/Documentation/7.0/Samples/csharp/Raven.Documentation.Samples/AiIntegration/VectorSearchUsingDynamicQuery.cs b/Documentation/7.0/Samples/csharp/Raven.Documentation.Samples/AiIntegration/VectorSearch/VectorSearchUsingDynamicQuery.cs similarity index 100% rename from Documentation/7.0/Samples/csharp/Raven.Documentation.Samples/AiIntegration/VectorSearchUsingDynamicQuery.cs rename to Documentation/7.0/Samples/csharp/Raven.Documentation.Samples/AiIntegration/VectorSearch/VectorSearchUsingDynamicQuery.cs diff --git a/Documentation/7.0/Samples/csharp/Raven.Documentation.Samples/AiIntegration/VectorSearchUsingStaticIndex.cs b/Documentation/7.0/Samples/csharp/Raven.Documentation.Samples/AiIntegration/VectorSearch/VectorSearchUsingStaticIndex.cs similarity index 100% rename from Documentation/7.0/Samples/csharp/Raven.Documentation.Samples/AiIntegration/VectorSearchUsingStaticIndex.cs rename to Documentation/7.0/Samples/csharp/Raven.Documentation.Samples/AiIntegration/VectorSearch/VectorSearchUsingStaticIndex.cs diff --git a/Documentation/7.0/Samples/csharp/Raven.Documentation.Samples/AiIntegration/VectorSearchWithAttachments.cs b/Documentation/7.0/Samples/csharp/Raven.Documentation.Samples/AiIntegration/VectorSearch/VectorSearchWithAttachments.cs similarity index 100% rename from Documentation/7.0/Samples/csharp/Raven.Documentation.Samples/AiIntegration/VectorSearchWithAttachments.cs rename to Documentation/7.0/Samples/csharp/Raven.Documentation.Samples/AiIntegration/VectorSearch/VectorSearchWithAttachments.cs