From ccd20b180453e916f1dd0885ec4e38ee54861724 Mon Sep 17 00:00:00 2001 From: Danielle9897 Date: Thu, 26 Mar 2026 21:32:09 +0200 Subject: [PATCH 1/6] RDoc-3706 Explain 'Filtered vector search queries' (C#, v7.2) --- ...ctor-search-using-dynamic-query-csharp.mdx | 62 ++++++++++--------- ...ector-search-using-static-index-csharp.mdx | 15 +++-- .../configuration/indexing-configuration.mdx | 20 ++++++ 3 files changed, 64 insertions(+), 33 deletions(-) diff --git a/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-csharp.mdx b/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-csharp.mdx index 86043d0228..c8900fa0ed 100644 --- a/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-csharp.mdx +++ b/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-csharp.mdx @@ -23,7 +23,8 @@ import CodeBlock from '@theme/CodeBlock'; * [Dynamic vector search - exact search](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#dynamic-vector-search---exact-search) * [Quantization options](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#quantization-options) * [Querying vector fields and regular data in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#querying-vector-fields-and-regular-data-in-the-same-query) - * [Combining multiple vector searches in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#combining-multiple-vector-searches-in-the-same-query) + * [How filtered vector search works](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#how-filtered-vector-search-works) + * [Combining multiple vector searches in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#combining-multiple-vector-searches-in-the-same-query) * [Syntax](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#syntax) @@ -1323,7 +1324,7 @@ where vector.search(TagsEmbeddedAsSingle, $queryVector, 0.85, 10) * You can perform a vector search and a regular search in the same query. A single auto-index will be created for both search predicates. -* In the following example, results will include Product documents with content similar to "italian food" in their _Name_ field and a _PricePerUnit_ above 20. +* In the following example, results will include Product documents with content similar to "italian food" in their _Name_ field AND a _PricePerUnit_ above 20. The following auto-index will be generated: `Auto/Products/ByPricePerUnitAndVector.search(embedding.text(Name))`. @@ -1415,35 +1416,38 @@ and (vector.search(embedding.text(Name), $searchTerm, 0.75, 16)) - - -**Impact of _NumberOfCandidates_ on query results**: - -* When combining a vector search with a filtering condition, the filter applies only to the documents retrieved within the `NumberOfCandidates` param limit. - Increasing or decreasing _NumberOfCandidates_ can affect the query results. - A larger _NumberOfCandidates_ increases the pool of documents considered, - improving the chances of finding results that match both the vector search and the filter condition. - -* For example, in the above query, the vector search executes with: Similarity `0.75f` and NumberOfCandidates `16`. - Running this query on RavenDB's sample data returns **2** documents. - -* However, if you increase _NumberOfCandidates_, the query will retrieve more candidate documents before applying the filtering condition. - If you run the following query: - - - -```sql -from "Products" -where (PricePerUnit > $minPrice) -// Run vector search with similarity 0.75 and NumberOfCandidates 25 -and (vector.search(embedding.text(Name), $searchTerm, 0.75, 25)) -{ "minPrice" : 35.0, "searchTerm" : "italian food" } -``` - - + + +### How filtered vector search works - now the query returns **4** documents instead of **2**. +When a vector search query is combined with a filtering condition using _AND_ (e.g., `where vector.search(...) and PricePerUnit > 35`), +RavenDB integrates the filter into the vector search process rather than running the vector search independently and discarding non-matching results afterward. +**Internal Strategies** +RavenDB first evaluates the filter to determine how many documents match and then dynamically selects a strategy: + +* **Exact search over filtered documents:** + This mode is triggered when any of the following conditions is true: + + * The filter match count is **below** the scanning threshold (default: `1024`). + Can be customized via the [Indexing.Corax.VectorSearch.VectorSearchScanningThreshold](../../../server/configuration/indexing-configuration.mdx#indexingcoraxvectorsearchvectorsearchscanningthreshold) configuration key. + * An [Exact search](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#dynamic-vector-search---exact-search) is explicitly requested. + * The requested _number of candidates_ exceeds half the filter match count. + Learn about the _number of candidates_ param in [The query parameters](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#the-dynamic-query-parameters). + + In this mode, an exact nearest-neighbor search is performed over **only** the documents that match the filter. + +* **Approximate search:** + When none of the conditions above apply, RavenDB uses approximate HNSW graph traversal to find the nearest vectors to the search term. + The filter is then applied to the results. + If the number of results that pass the filter is **less** than the requested _number of candidates_, + RavenDB increases the internal candidate count and continues the HNSW search. + This is an iterative process that ensures that enough results matching both vector similarity and the filtering condition are found. + + Note: + Re-search rounds are efficient because RavenDB caches the HNSW graph's internal state (including previously computed results), + avoiding redundant distance calculations for previously visited nodes. + ## Combining multiple vector searches in the same query diff --git a/docs/ai-integration/vector-search/content/_vector-search-using-static-index-csharp.mdx b/docs/ai-integration/vector-search/content/_vector-search-using-static-index-csharp.mdx index 41f8473a16..19dccd8f55 100644 --- a/docs/ai-integration/vector-search/content/_vector-search-using-static-index-csharp.mdx +++ b/docs/ai-integration/vector-search/content/_vector-search-using-static-index-csharp.mdx @@ -1668,11 +1668,18 @@ or vector.search(VectorFromText, $searchTerm2, 0.8) -* Note: -You can also combine **multiple vector search statements** in a single query using logical operators. -An example is available in: -[Combining multiple vector searches in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#combining-multiple-vector-searches-in-the-same-query). + + +* **Multiple vector searches**: + You can combine multiple vector search statements in a single query using logical operators. + An example is available in: + [Combining multiple vector searches in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#combining-multiple-vector-searches-in-the-same-query). + +* **Vector search with filtering**: + You can also combine vector search with filtering conditions on regular (non-vector) fields in the same query. + Learn more in [Querying vector fields and regular data in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#querying-vector-fields-and-regular-data-in-the-same-query). + --- diff --git a/docs/server/configuration/indexing-configuration.mdx b/docs/server/configuration/indexing-configuration.mdx index dddcb7baba..2e1f67f6a6 100644 --- a/docs/server/configuration/indexing-configuration.mdx +++ b/docs/server/configuration/indexing-configuration.mdx @@ -73,6 +73,7 @@ import LanguageContent from "@site/src/components/LanguageContent"; [Indexing.Corax.VectorSearch.DefaultNumberOfEdges](../../server/configuration/indexing-configuration.mdx#indexingcoraxvectorsearchdefaultnumberofedges) [Indexing.Corax.VectorSearch.MaximumConcurrentBatchesForHnswAcceleration](../../server/configuration/indexing-configuration.mdx#indexingcoraxvectorsearchmaximumconcurrentbatchesforhnswacceleration) [Indexing.Corax.VectorSearch.OrderByScoreAutomatically](../../server/configuration/indexing-configuration.mdx#indexingcoraxvectorsearchorderbyscoreautomatically) + [Indexing.Corax.VectorSearch.VectorSearchScanningThreshold](../../server/configuration/indexing-configuration.mdx#indexingcoraxvectorsearchvectorsearchscanningthreshold) [Indexing.Encrypted.TransactionSizeLimitInMb](../../server/configuration/indexing-configuration.mdx#indexingencryptedtransactionsizelimitinmb) [Indexing.IndexEmptyEntries](../../server/configuration/indexing-configuration.mdx#indexingindexemptyentries) [Indexing.IndexMissingFieldsAsNull](../../server/configuration/indexing-configuration.mdx#indexingindexmissingfieldsasnull) @@ -651,6 +652,25 @@ Order by score automatically when `vector.search` is inside a query. +## Indexing.Corax.VectorSearch.VectorSearchScanningThreshold + +EXPERT ONLY: + +* The threshold of filter match count for exact scanning instead of approximate search. + +* When a vector search query is combined with a filtering condition using _AND_, the filter is integrated directly into the vector search. + If the number of documents matching the filter is **below** this threshold, an exact search is performed over the filtered documents rather than using the HNSW approximate search. + +* Learn more in [How filtered vector search works](../../ai-integration/vector-search/vector-search-using-static-index.mdx#how-filtered-vector-search-works). + +--- + +- **Type**: `int` +- **Default**: `1024` +- **Scope**: Server-wide, or per database, or per index + + + ## Indexing.Encrypted.TransactionSizeLimitInMb * Transaction size limit in megabytes for _encrypted_ databases, after which an index will stop and complete the current batch. From a6d15fac9a4bcb85be3ed9fe58cce2d9ccf23ae2 Mon Sep 17 00:00:00 2001 From: Danielle9897 Date: Thu, 26 Mar 2026 22:25:19 +0200 Subject: [PATCH 2/6] RDoc-3706 Explain 'Filtered vector search queries' (Node.js & Python, v7.2) --- ...ctor-search-using-dynamic-query-nodejs.mdx | 58 ++++++++++--------- ...ctor-search-using-dynamic-query-python.mdx | 52 ++++++++++------- ...ector-search-using-static-index-nodejs.mdx | 13 +++++ ...ector-search-using-static-index-python.mdx | 15 +++-- 4 files changed, 86 insertions(+), 52 deletions(-) diff --git a/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-nodejs.mdx b/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-nodejs.mdx index 7e30e3e5aa..085160a01d 100644 --- a/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-nodejs.mdx +++ b/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-nodejs.mdx @@ -23,6 +23,7 @@ import CodeBlock from '@theme/CodeBlock'; * [Dynamic vector search - exact search](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#dynamic-vector-search---exact-search) * [Quantization options](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#quantization-options) * [Querying vector fields and regular data in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#querying-vector-fields-and-regular-data-in-the-same-query) + * [How filtered vector search works](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#how-filtered-vector-search-works) * [Combining multiple vector searches in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#combining-multiple-vector-searches-in-the-same-query) * [Syntax](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#syntax) @@ -962,35 +963,38 @@ and (vector.search(embedding.text(Name), $searchTerm, 0.75, 16)) - - -**Impact of _numberOfCandidates_ on query results**: - -* When combining a vector search with a filtering condition, the filter applies only to the documents retrieved within the `numberOfCandidates` param limit. - Increasing or decreasing _numberOfCandidates_ can affect the query results. - A larger _numberOfCandidates_ increases the pool of documents considered, - improving the chances of finding results that match both the vector search and the filter condition. - -* For example, in the above query, the vector search executes with: similarity `0.75` and numberOfCandidates `16`. - Running this query on RavenDB's sample data returns **2** documents. - -* However, if you increase _numberOfCandidates_, the query will retrieve more candidate documents before applying the filtering condition. - If you run the following query: - - - -```sql -from "Products" -where (PricePerUnit > $minPrice) -// Run vector search with similarity 0.75 and numberOfCandidates 25 -and (vector.search(embedding.text(Name), $searchTerm, 0.75, 25)) -{ "minPrice" : 35.0, "searchTerm" : "italian food" } -``` - - + + +### How filtered vector search works - now the query returns **4** documents instead of **2**. +When a vector search query is combined with a filtering condition using _AND_ (e.g., `where vector.search(...) and PricePerUnit > 35`), +RavenDB integrates the filter into the vector search process rather than running the vector search independently and discarding non-matching results afterward. +**Internal Strategies** +RavenDB first evaluates the filter to determine how many documents match and then dynamically selects a strategy: + +* **Exact search over filtered documents:** + This mode is triggered when any of the following conditions is true: + + * The filter match count is **below** the scanning threshold (default: `1024`). + Can be customized via the [Indexing.Corax.VectorSearch.VectorSearchScanningThreshold](../../../server/configuration/indexing-configuration.mdx#indexingcoraxvectorsearchvectorsearchscanningthreshold) configuration key. + * An [Exact search](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#dynamic-vector-search---exact-search) is explicitly requested. + * The requested _number of candidates_ exceeds half the filter match count. + Learn about the _number of candidates_ param in [The query parameters](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#the-dynamic-query-parameters). + + In this mode, an exact nearest-neighbor search is performed over **only** the documents that match the filter. + +* **Approximate search:** + When none of the conditions above apply, RavenDB uses approximate HNSW graph traversal to find the nearest vectors to the search term. + The filter is then applied to the results. + If the number of results that pass the filter is **less** than the requested _number of candidates_, + RavenDB increases the internal candidate count and continues the HNSW search. + This is an iterative process that ensures that enough results matching both vector similarity and the filtering condition are found. + + Note: + Re-search rounds are efficient because RavenDB caches the HNSW graph's internal state (including previously computed results), + avoiding redundant distance calculations for previously visited nodes. + ## Combining multiple vector searches in the same query diff --git a/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-python.mdx b/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-python.mdx index 80c9849d88..14b68b82e6 100644 --- a/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-python.mdx +++ b/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-python.mdx @@ -23,6 +23,7 @@ import CodeBlock from '@theme/CodeBlock'; * [Dynamic vector search - exact search](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#dynamic-vector-search---exact-search) * [Quantization options](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#quantization-options) * [Querying vector fields and regular data in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#querying-vector-fields-and-regular-data-in-the-same-query) + * [How filtered vector search works](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#how-filtered-vector-search-works) * [Combining multiple vector searches in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#combining-multiple-vector-searches-in-the-same-query) * [Syntax](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#syntax) @@ -820,29 +821,38 @@ and (vector.search(embedding.text(Name), $searchTerm, 0.75, 16)) - - -**Impact of _NumberOfCandidates_ on query results**: - -* When combining a vector search with a filtering condition, the filter applies only to the documents retrieved within the `NumberOfCandidates` param limit. - Increasing or decreasing _NumberOfCandidates_ can affect the query results. - A larger _NumberOfCandidates_ increases the pool of documents considered, - improving the chances of finding results that match both the vector search and the filter condition. - -* For example, in the above query, the vector search executes with: Similarity `0.75` and NumberOfCandidates `16`. - Running this query on RavenDB's sample data returns **2** documents. + + +### How filtered vector search works -* However, if you increase _NumberOfCandidates_, the query will retrieve more candidate documents before applying the filtering condition. - If you run the following query: - ```sql - from "Products" - where (PricePerUnit > $minPrice) - // Run vector search with similarity 0.75 and NumberOfCandidates 25 - and (vector.search(embedding.text(Name), $searchTerm, 0.75, 25)) - { "minPrice" : 35.0, "searchTerm" : "italian food" } - ``` - now the query returns **4** documents instead of **2**. +When a vector search query is combined with a filtering condition using _AND_ (e.g., `where vector.search(...) and PricePerUnit > 35`), +RavenDB integrates the filter into the vector search process rather than running the vector search independently and discarding non-matching results afterward. +**Internal Strategies** +RavenDB first evaluates the filter to determine how many documents match and then dynamically selects a strategy: + +* **Exact search over filtered documents:** + This mode is triggered when any of the following conditions is true: + + * The filter match count is **below** the scanning threshold (default: `1024`). + Can be customized via the [Indexing.Corax.VectorSearch.VectorSearchScanningThreshold](../../../server/configuration/indexing-configuration.mdx#indexingcoraxvectorsearchvectorsearchscanningthreshold) configuration key. + * An [Exact search](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#dynamic-vector-search---exact-search) is explicitly requested. + * The requested _number of candidates_ exceeds half the filter match count. + Learn about the _number of candidates_ param in [The query parameters](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#the-dynamic-query-parameters). + + In this mode, an exact nearest-neighbor search is performed over **only** the documents that match the filter. + +* **Approximate search:** + When none of the conditions above apply, RavenDB uses approximate HNSW graph traversal to find the nearest vectors to the search term. + The filter is then applied to the results. + If the number of results that pass the filter is **less** than the requested _number of candidates_, + RavenDB increases the internal candidate count and continues the HNSW search. + This is an iterative process that ensures that enough results matching both vector similarity and the filtering condition are found. + + Note: + Re-search rounds are efficient because RavenDB caches the HNSW graph's internal state (including previously computed results), + avoiding redundant distance calculations for previously visited nodes. + ## Combining multiple vector searches in the same query diff --git a/docs/ai-integration/vector-search/content/_vector-search-using-static-index-nodejs.mdx b/docs/ai-integration/vector-search/content/_vector-search-using-static-index-nodejs.mdx index e38ce8eb1d..5c16733b2d 100644 --- a/docs/ai-integration/vector-search/content/_vector-search-using-static-index-nodejs.mdx +++ b/docs/ai-integration/vector-search/content/_vector-search-using-static-index-nodejs.mdx @@ -978,6 +978,19 @@ or vector.search(vectorFromText, $searchTerm2, 0.8) + + +* **Multiple vector searches**: + You can combine multiple vector search statements in a single query using logical operators. + An example is available in: + [Combining multiple vector searches in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#combining-multiple-vector-searches-in-the-same-query). + +* **Vector search with filtering**: + You can also combine vector search with filtering conditions on regular (non-vector) fields in the same query. + Learn more in [Querying vector fields and regular data in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#querying-vector-fields-and-regular-data-in-the-same-query). + + + --- ## Querying the static index for similar documents diff --git a/docs/ai-integration/vector-search/content/_vector-search-using-static-index-python.mdx b/docs/ai-integration/vector-search/content/_vector-search-using-static-index-python.mdx index 5f11d63fda..b165f7722e 100644 --- a/docs/ai-integration/vector-search/content/_vector-search-using-static-index-python.mdx +++ b/docs/ai-integration/vector-search/content/_vector-search-using-static-index-python.mdx @@ -865,11 +865,18 @@ or vector.search(vector_from_text, $searchTerm2, 0.8) -* Note: -You can also combine **multiple vector search statements** in a single query using logical operators. -An example is available in: -[Combining multiple vector searches in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#combining-multiple-vector-searches-in-the-same-query). + + +* **Multiple vector searches**: + You can combine multiple vector search statements in a single query using logical operators. + An example is available in: + [Combining multiple vector searches in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#combining-multiple-vector-searches-in-the-same-query). + +* **Vector search with filtering**: + You can also combine vector search with filtering conditions on regular (non-vector) fields in the same query. + Learn more in [Querying vector fields and regular data in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#querying-vector-fields-and-regular-data-in-the-same-query). + --- From 76c3fb35ca3924efaff18c0be8cec3d4e0917f3e Mon Sep 17 00:00:00 2001 From: Danielle9897 Date: Thu, 26 Mar 2026 22:33:51 +0200 Subject: [PATCH 3/6] RDoc-3706 Explain 'Filtered vector search queries' (C#, Node.js & Python, v7.1) --- ...ctor-search-using-dynamic-query-csharp.mdx | 58 ++++++++++--------- ...ctor-search-using-dynamic-query-nodejs.mdx | 58 ++++++++++--------- ...ctor-search-using-dynamic-query-python.mdx | 52 ++++++++++------- ...ector-search-using-static-index-csharp.mdx | 15 +++-- ...ector-search-using-static-index-nodejs.mdx | 13 +++++ ...ector-search-using-static-index-python.mdx | 15 +++-- .../configuration/indexing-configuration.mdx | 20 +++++++ 7 files changed, 148 insertions(+), 83 deletions(-) diff --git a/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-csharp.mdx b/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-csharp.mdx index 29a24b6914..b9cc8e654b 100644 --- a/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-csharp.mdx +++ b/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-csharp.mdx @@ -23,6 +23,7 @@ import CodeBlock from '@theme/CodeBlock'; * [Dynamic vector search - exact search](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#dynamic-vector-search---exact-search) * [Quantization options](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#quantization-options) * [Querying vector fields and regular data in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#querying-vector-fields-and-regular-data-in-the-same-query) + * [How filtered vector search works](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#how-filtered-vector-search-works) * [Combining multiple vector searches in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#combining-multiple-vector-searches-in-the-same-query) * [Syntax](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#syntax) @@ -1415,35 +1416,38 @@ and (vector.search(embedding.text(Name), $searchTerm, 0.75, 16)) - - -**Impact of _NumberOfCandidates_ on query results**: - -* When combining a vector search with a filtering condition, the filter applies only to the documents retrieved within the `NumberOfCandidates` param limit. - Increasing or decreasing _NumberOfCandidates_ can affect the query results. - A larger _NumberOfCandidates_ increases the pool of documents considered, - improving the chances of finding results that match both the vector search and the filter condition. - -* For example, in the above query, the vector search executes with: Similarity `0.75f` and NumberOfCandidates `16`. - Running this query on RavenDB's sample data returns **2** documents. - -* However, if you increase _NumberOfCandidates_, the query will retrieve more candidate documents before applying the filtering condition. - If you run the following query: - - - -```sql -from "Products" -where (PricePerUnit > $minPrice) -// Run vector search with similarity 0.75 and NumberOfCandidates 25 -and (vector.search(embedding.text(Name), $searchTerm, 0.75, 25)) -{ "minPrice" : 35.0, "searchTerm" : "italian food" } -``` - - + + +### How filtered vector search works - now the query returns **4** documents instead of **2**. +When a vector search query is combined with a filtering condition using _AND_ (e.g., `where vector.search(...) and PricePerUnit > 35`), +RavenDB integrates the filter into the vector search process rather than running the vector search independently and discarding non-matching results afterward. +**Internal Strategies** +RavenDB first evaluates the filter to determine how many documents match and then dynamically selects a strategy: + +* **Exact search over filtered documents:** + This mode is triggered when any of the following conditions is true: + + * The filter match count is **below** the scanning threshold (default: `1024`). + Can be customized via the [Indexing.Corax.VectorSearch.VectorSearchScanningThreshold](../../../server/configuration/indexing-configuration.mdx#indexingcoraxvectorsearchvectorsearchscanningthreshold) configuration key. + * An [Exact search](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#dynamic-vector-search---exact-search) is explicitly requested. + * The requested _number of candidates_ exceeds half the filter match count. + Learn about the _number of candidates_ param in [The query parameters](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#the-dynamic-query-parameters). + + In this mode, an exact nearest-neighbor search is performed over **only** the documents that match the filter. + +* **Approximate search:** + When none of the conditions above apply, RavenDB uses approximate HNSW graph traversal to find the nearest vectors to the search term. + The filter is then applied to the results. + If the number of results that pass the filter is **less** than the requested _number of candidates_, + RavenDB increases the internal candidate count and continues the HNSW search. + This is an iterative process that ensures that enough results matching both vector similarity and the filtering condition are found. + + Note: + Re-search rounds are efficient because RavenDB caches the HNSW graph's internal state (including previously computed results), + avoiding redundant distance calculations for previously visited nodes. + ## Combining multiple vector searches in the same query diff --git a/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-nodejs.mdx b/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-nodejs.mdx index ef8ab2f437..e3bab19b1a 100644 --- a/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-nodejs.mdx +++ b/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-nodejs.mdx @@ -23,6 +23,7 @@ import CodeBlock from '@theme/CodeBlock'; * [Dynamic vector search - exact search](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#dynamic-vector-search---exact-search) * [Quantization options](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#quantization-options) * [Querying vector fields and regular data in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#querying-vector-fields-and-regular-data-in-the-same-query) + * [How filtered vector search works](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#how-filtered-vector-search-works) * [Combining multiple vector searches in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#combining-multiple-vector-searches-in-the-same-query) * [Syntax](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#syntax) @@ -962,35 +963,38 @@ and (vector.search(embedding.text(Name), $searchTerm, 0.75, 16)) - - -**Impact of _numberOfCandidates_ on query results**: - -* When combining a vector search with a filtering condition, the filter applies only to the documents retrieved within the `numberOfCandidates` param limit. - Increasing or decreasing _numberOfCandidates_ can affect the query results. - A larger _numberOfCandidates_ increases the pool of documents considered, - improving the chances of finding results that match both the vector search and the filter condition. - -* For example, in the above query, the vector search executes with: similarity `0.75` and numberOfCandidates `16`. - Running this query on RavenDB's sample data returns **2** documents. - -* However, if you increase _numberOfCandidates_, the query will retrieve more candidate documents before applying the filtering condition. - If you run the following query: - - - -```sql -from "Products" -where (PricePerUnit > $minPrice) -// Run vector search with similarity 0.75 and numberOfCandidates 25 -and (vector.search(embedding.text(Name), $searchTerm, 0.75, 25)) -{ "minPrice" : 35.0, "searchTerm" : "italian food" } -``` - - + + +### How filtered vector search works - now the query returns **4** documents instead of **2**. +When a vector search query is combined with a filtering condition using _AND_ (e.g., `where vector.search(...) and PricePerUnit > 35`), +RavenDB integrates the filter into the vector search process rather than running the vector search independently and discarding non-matching results afterward. +**Internal Strategies** +RavenDB first evaluates the filter to determine how many documents match and then dynamically selects a strategy: + +* **Exact search over filtered documents:** + This mode is triggered when any of the following conditions is true: + + * The filter match count is **below** the scanning threshold (default: `1024`). + Can be customized via the [Indexing.Corax.VectorSearch.VectorSearchScanningThreshold](../../../server/configuration/indexing-configuration.mdx#indexingcoraxvectorsearchvectorsearchscanningthreshold) configuration key. + * An [Exact search](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#dynamic-vector-search---exact-search) is explicitly requested. + * The requested _number of candidates_ exceeds half the filter match count. + Learn about the _number of candidates_ param in [The query parameters](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#the-dynamic-query-parameters). + + In this mode, an exact nearest-neighbor search is performed over **only** the documents that match the filter. + +* **Approximate search:** + When none of the conditions above apply, RavenDB uses approximate HNSW graph traversal to find the nearest vectors to the search term. + The filter is then applied to the results. + If the number of results that pass the filter is **less** than the requested _number of candidates_, + RavenDB increases the internal candidate count and continues the HNSW search. + This is an iterative process that ensures that enough results matching both vector similarity and the filtering condition are found. + + Note: + Re-search rounds are efficient because RavenDB caches the HNSW graph's internal state (including previously computed results), + avoiding redundant distance calculations for previously visited nodes. + ## Combining multiple vector searches in the same query diff --git a/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-python.mdx b/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-python.mdx index 192e10ed93..9cd63d7b72 100644 --- a/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-python.mdx +++ b/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-python.mdx @@ -23,6 +23,7 @@ import CodeBlock from '@theme/CodeBlock'; * [Dynamic vector search - exact search](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#dynamic-vector-search---exact-search) * [Quantization options](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#quantization-options) * [Querying vector fields and regular data in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#querying-vector-fields-and-regular-data-in-the-same-query) + * [How filtered vector search works](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#how-filtered-vector-search-works) * [Combining multiple vector searches in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#combining-multiple-vector-searches-in-the-same-query) * [Syntax](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#syntax) @@ -820,29 +821,38 @@ and (vector.search(embedding.text(Name), $searchTerm, 0.75, 16)) - - -**Impact of _NumberOfCandidates_ on query results**: - -* When combining a vector search with a filtering condition, the filter applies only to the documents retrieved within the `NumberOfCandidates` param limit. - Increasing or decreasing _NumberOfCandidates_ can affect the query results. - A larger _NumberOfCandidates_ increases the pool of documents considered, - improving the chances of finding results that match both the vector search and the filter condition. - -* For example, in the above query, the vector search executes with: Similarity `0.75` and NumberOfCandidates `16`. - Running this query on RavenDB's sample data returns **2** documents. + + +### How filtered vector search works -* However, if you increase _NumberOfCandidates_, the query will retrieve more candidate documents before applying the filtering condition. - If you run the following query: - ```sql - from "Products" - where (PricePerUnit > $minPrice) - // Run vector search with similarity 0.75 and NumberOfCandidates 25 - and (vector.search(embedding.text(Name), $searchTerm, 0.75, 25)) - { "minPrice" : 35.0, "searchTerm" : "italian food" } - ``` - now the query returns **4** documents instead of **2**. +When a vector search query is combined with a filtering condition using _AND_ (e.g., `where vector.search(...) and PricePerUnit > 35`), +RavenDB integrates the filter into the vector search process rather than running the vector search independently and discarding non-matching results afterward. +**Internal Strategies** +RavenDB first evaluates the filter to determine how many documents match and then dynamically selects a strategy: + +* **Exact search over filtered documents:** + This mode is triggered when any of the following conditions is true: + + * The filter match count is **below** the scanning threshold (default: `1024`). + Can be customized via the [Indexing.Corax.VectorSearch.VectorSearchScanningThreshold](../../../server/configuration/indexing-configuration.mdx#indexingcoraxvectorsearchvectorsearchscanningthreshold) configuration key. + * An [Exact search](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#dynamic-vector-search---exact-search) is explicitly requested. + * The requested _number of candidates_ exceeds half the filter match count. + Learn about the _number of candidates_ param in [The query parameters](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#the-dynamic-query-parameters). + + In this mode, an exact nearest-neighbor search is performed over **only** the documents that match the filter. + +* **Approximate search:** + When none of the conditions above apply, RavenDB uses approximate HNSW graph traversal to find the nearest vectors to the search term. + The filter is then applied to the results. + If the number of results that pass the filter is **less** than the requested _number of candidates_, + RavenDB increases the internal candidate count and continues the HNSW search. + This is an iterative process that ensures that enough results matching both vector similarity and the filtering condition are found. + + Note: + Re-search rounds are efficient because RavenDB caches the HNSW graph's internal state (including previously computed results), + avoiding redundant distance calculations for previously visited nodes. + ## Combining multiple vector searches in the same query diff --git a/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-static-index-csharp.mdx b/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-static-index-csharp.mdx index c8b4ae88a3..dd72f8a712 100644 --- a/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-static-index-csharp.mdx +++ b/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-static-index-csharp.mdx @@ -1668,11 +1668,18 @@ or vector.search(VectorFromText, $searchTerm2, 0.8) -* Note: -You can also combine **multiple vector search statements** in a single query using logical operators. -An example is available in: -[Combining multiple vector searches in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#combining-multiple-vector-searches-in-the-same-query). + + +* **Multiple vector searches**: + You can combine multiple vector search statements in a single query using logical operators. + An example is available in: + [Combining multiple vector searches in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#combining-multiple-vector-searches-in-the-same-query). + +* **Vector search with filtering**: + You can also combine vector search with filtering conditions on regular (non-vector) fields in the same query. + Learn more in [Querying vector fields and regular data in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#querying-vector-fields-and-regular-data-in-the-same-query). + --- diff --git a/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-static-index-nodejs.mdx b/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-static-index-nodejs.mdx index cb4eab3dd3..690acf32e8 100644 --- a/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-static-index-nodejs.mdx +++ b/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-static-index-nodejs.mdx @@ -978,6 +978,19 @@ or vector.search(vectorFromText, $searchTerm2, 0.8) + + +* **Multiple vector searches**: + You can combine multiple vector search statements in a single query using logical operators. + An example is available in: + [Combining multiple vector searches in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#combining-multiple-vector-searches-in-the-same-query). + +* **Vector search with filtering**: + You can also combine vector search with filtering conditions on regular (non-vector) fields in the same query. + Learn more in [Querying vector fields and regular data in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#querying-vector-fields-and-regular-data-in-the-same-query). + + + --- ## Querying the static index for similar documents diff --git a/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-static-index-python.mdx b/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-static-index-python.mdx index db8a33203b..8072693147 100644 --- a/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-static-index-python.mdx +++ b/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-static-index-python.mdx @@ -865,11 +865,18 @@ or vector.search(vector_from_text, $searchTerm2, 0.8) -* Note: -You can also combine **multiple vector search statements** in a single query using logical operators. -An example is available in: -[Combining multiple vector searches in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#combining-multiple-vector-searches-in-the-same-query). + + +* **Multiple vector searches**: + You can combine multiple vector search statements in a single query using logical operators. + An example is available in: + [Combining multiple vector searches in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#combining-multiple-vector-searches-in-the-same-query). + +* **Vector search with filtering**: + You can also combine vector search with filtering conditions on regular (non-vector) fields in the same query. + Learn more in [Querying vector fields and regular data in the same query](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#querying-vector-fields-and-regular-data-in-the-same-query). + --- diff --git a/versioned_docs/version-7.1/server/configuration/indexing-configuration.mdx b/versioned_docs/version-7.1/server/configuration/indexing-configuration.mdx index dddcb7baba..2e1f67f6a6 100644 --- a/versioned_docs/version-7.1/server/configuration/indexing-configuration.mdx +++ b/versioned_docs/version-7.1/server/configuration/indexing-configuration.mdx @@ -73,6 +73,7 @@ import LanguageContent from "@site/src/components/LanguageContent"; [Indexing.Corax.VectorSearch.DefaultNumberOfEdges](../../server/configuration/indexing-configuration.mdx#indexingcoraxvectorsearchdefaultnumberofedges) [Indexing.Corax.VectorSearch.MaximumConcurrentBatchesForHnswAcceleration](../../server/configuration/indexing-configuration.mdx#indexingcoraxvectorsearchmaximumconcurrentbatchesforhnswacceleration) [Indexing.Corax.VectorSearch.OrderByScoreAutomatically](../../server/configuration/indexing-configuration.mdx#indexingcoraxvectorsearchorderbyscoreautomatically) + [Indexing.Corax.VectorSearch.VectorSearchScanningThreshold](../../server/configuration/indexing-configuration.mdx#indexingcoraxvectorsearchvectorsearchscanningthreshold) [Indexing.Encrypted.TransactionSizeLimitInMb](../../server/configuration/indexing-configuration.mdx#indexingencryptedtransactionsizelimitinmb) [Indexing.IndexEmptyEntries](../../server/configuration/indexing-configuration.mdx#indexingindexemptyentries) [Indexing.IndexMissingFieldsAsNull](../../server/configuration/indexing-configuration.mdx#indexingindexmissingfieldsasnull) @@ -651,6 +652,25 @@ Order by score automatically when `vector.search` is inside a query. +## Indexing.Corax.VectorSearch.VectorSearchScanningThreshold + +EXPERT ONLY: + +* The threshold of filter match count for exact scanning instead of approximate search. + +* When a vector search query is combined with a filtering condition using _AND_, the filter is integrated directly into the vector search. + If the number of documents matching the filter is **below** this threshold, an exact search is performed over the filtered documents rather than using the HNSW approximate search. + +* Learn more in [How filtered vector search works](../../ai-integration/vector-search/vector-search-using-static-index.mdx#how-filtered-vector-search-works). + +--- + +- **Type**: `int` +- **Default**: `1024` +- **Scope**: Server-wide, or per database, or per index + + + ## Indexing.Encrypted.TransactionSizeLimitInMb * Transaction size limit in megabytes for _encrypted_ databases, after which an index will stop and complete the current batch. From b6ca3dfa388df48bbcf864ca203a4d90e86bcc65 Mon Sep 17 00:00:00 2001 From: Danielle9897 Date: Thu, 26 Mar 2026 22:43:53 +0200 Subject: [PATCH 4/6] RDoc-3706 Fix fenced code blocks --- ...vector-search-using-static-index-python.mdx | 18 ++++++------------ ...vector-search-using-static-index-python.mdx | 18 ++++++------------ 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/docs/ai-integration/vector-search/content/_vector-search-using-static-index-python.mdx b/docs/ai-integration/vector-search/content/_vector-search-using-static-index-python.mdx index b165f7722e..5a681800c9 100644 --- a/docs/ai-integration/vector-search/content/_vector-search-using-static-index-python.mdx +++ b/docs/ai-integration/vector-search/content/_vector-search-using-static-index-python.mdx @@ -277,11 +277,10 @@ similar_products = list( ```sql -{`from index "Products/ByVector/Text" +from index "Products/ByVector/Text" // Optionally, wrap the 'vector.search' query with 'exact()' to perform an exact search where exact(vector.search(vector_from_text, $searchTerm, 0.82, 20)) { "searchTerm" : "italian food" } -`} ``` @@ -377,11 +376,10 @@ similar_categories = list( ```sql -{`from index "Categories/ByPreMadeTextEmbeddings" +from index "Categories/ByPreMadeTextEmbeddings" // Optionally, wrap the 'vector.search' query with 'exact()' to perform an exact search where exact(vector.search(vector_from_text_embeddings, $p0, 0.75, 20)) { "p0": "candy" } -`} ``` @@ -529,10 +527,9 @@ similar_movies = list( ```sql -{`from index "Movies/ByVector/Single" +from index "Movies/ByVector/Single" where vector.search(vector_from_single, $queryVector) { "queryVector" : { "@vector" : [6.599999904632568, 7.699999809265137] }} -`} ``` @@ -641,10 +638,9 @@ similar_movies = list( ```sql -{`from index "Movies/ByVector/Int8" +from index "Movies/ByVector/Int8" where vector.search(vector_from_int8_arrays, $queryVector) { "queryVector" : [64, 127, -51, -52, 76, 62] } -`} ``` @@ -855,12 +851,11 @@ results = list( ```sql -{`from index "Products/ByMultipleFields" +from index "Products/ByMultipleFields" where price_per_unit > $minPrice or search(name, $searchTerm1) or vector.search(vector_from_text, $searchTerm2, 0.8) { "minPrice" : 200, "searchTerm1" : "Alice", "searchTerm2": "italian food" } -`} ``` @@ -908,11 +903,10 @@ results = list( ```sql -{`from index "Products/ByVector/Text" +from index "Products/ByVector/Text" // Pass a document ID to the 'forDoc' method to find similar documents where vector.search(vector_from_text, embedding.forDoc($documentID), 0.82) {"documentID" : "Products/7-A"} -`} ``` diff --git a/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-static-index-python.mdx b/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-static-index-python.mdx index 8072693147..e0f5fcb769 100644 --- a/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-static-index-python.mdx +++ b/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-static-index-python.mdx @@ -277,11 +277,10 @@ similar_products = list( ```sql -{`from index "Products/ByVector/Text" +from index "Products/ByVector/Text" // Optionally, wrap the 'vector.search' query with 'exact()' to perform an exact search where exact(vector.search(vector_from_text, $searchTerm, 0.82, 20)) { "searchTerm" : "italian food" } -`} ``` @@ -377,11 +376,10 @@ similar_categories = list( ```sql -{`from index "Categories/ByPreMadeTextEmbeddings" +from index "Categories/ByPreMadeTextEmbeddings" // Optionally, wrap the 'vector.search' query with 'exact()' to perform an exact search where exact(vector.search(vector_from_text_embeddings, $p0, 0.75, 20)) { "p0": "candy" } -`} ``` @@ -529,10 +527,9 @@ similar_movies = list( ```sql -{`from index "Movies/ByVector/Single" +from index "Movies/ByVector/Single" where vector.search(vector_from_single, $queryVector) { "queryVector" : { "@vector" : [6.599999904632568, 7.699999809265137] }} -`} ``` @@ -641,10 +638,9 @@ similar_movies = list( ```sql -{`from index "Movies/ByVector/Int8" +from index "Movies/ByVector/Int8" where vector.search(vector_from_int8_arrays, $queryVector) { "queryVector" : [64, 127, -51, -52, 76, 62] } -`} ``` @@ -855,12 +851,11 @@ results = list( ```sql -{`from index "Products/ByMultipleFields" +from index "Products/ByMultipleFields" where price_per_unit > $minPrice or search(name, $searchTerm1) or vector.search(vector_from_text, $searchTerm2, 0.8) { "minPrice" : 200, "searchTerm1" : "Alice", "searchTerm2": "italian food" } -`} ``` @@ -908,11 +903,10 @@ results = list( ```sql -{`from index "Products/ByVector/Text" +from index "Products/ByVector/Text" // Pass a document ID to the 'forDoc' method to find similar documents where vector.search(vector_from_text, embedding.forDoc($documentID), 0.82) {"documentID" : "Products/7-A"} -`} ``` From 856da3a9424348a95fe392a32005b65bee97574a Mon Sep 17 00:00:00 2001 From: Danielle9897 Date: Thu, 26 Mar 2026 23:12:01 +0200 Subject: [PATCH 5/6] RDoc-3706 Added info in the 'Server breaking changes' article (v7.1) --- .../server/server-breaking-changes.mdx | 96 +++++++++++-------- 1 file changed, 55 insertions(+), 41 deletions(-) diff --git a/versioned_docs/version-7.1/migration/server/server-breaking-changes.mdx b/versioned_docs/version-7.1/migration/server/server-breaking-changes.mdx index 5a2afdc8ca..62308222da 100644 --- a/versioned_docs/version-7.1/migration/server/server-breaking-changes.mdx +++ b/versioned_docs/version-7.1/migration/server/server-breaking-changes.mdx @@ -1,6 +1,6 @@ --- title: "Migration: Server Breaking Changes" -sidebar_label: Server Breaking Changes +sidebar_label: "Server Breaking Changes" sidebar_position: 2 --- @@ -10,61 +10,75 @@ import TabItem from '@theme/TabItem'; import CodeBlock from '@theme/CodeBlock'; import LanguageSwitcher from "@site/src/components/LanguageSwitcher"; import LanguageContent from "@site/src/components/LanguageContent"; +import Panel from "@site/src/components/Panel"; +import ContentFrame from "@site/src/components/ContentFrame"; -# Migration: Server Breaking Changes + The features listed on this page were available in former RavenDB versions. -In RavenDB `7.0.x`, they are either unavailable or their behavior is inconsistent -with their behavior in previous versions. +In RavenDB `7.1.x`, they are either unavailable or their behavior is inconsistent with their behavior in previous versions. -* In this page: +* In this article: * [RavenDB now incorporates NLog as its logging system](../../migration/server/server-breaking-changes.mdx#ravendb-incorporates-nlog-as-its-logging-system) * [Removed obsolete properties](../../migration/server/server-breaking-changes.mdx#removed-obsolete-properties) + * [Filtered vector search behavior](../../migration/server/server-breaking-changes.mdx#filtered-vector-search-behavior) -## RavenDB incorporates NLog as its logging system + -RavenDB's logging system has changed; the server now incorporates the -NLog logging framework and writes all log data through it. -One of the changes that NLog brings to RavenDB is the richer set -of logging levels, visible right away through Studio's [admin-logs view](../../studio/server/debug/admin-logs.mdx). -Read more about Nlog [in the dedicated article](../../server/troubleshooting/logging.mdx). -If you migrate to RavenDB `7.x` from an earlier version, please -read the section related to NLog in the [migration page](../../migration/server/data-migration.mdx). +* RavenDB's logging system has changed; the server now incorporates the NLog logging framework and writes all log data through it. +* One of the changes that NLog brings to RavenDB is the richer set of logging levels, visible right away through Studio's [admin-logs view](../../studio/server/debug/admin-logs.mdx). +* Read more about Nlog [in the dedicated article](../../server/troubleshooting/logging.mdx). + If you migrate to RavenDB `7.x` from an earlier version, please read the section related to NLog in the [migration page](../../migration/server/data-migration.mdx). + -## Removed obsolete properties -The following properties are no longer in use, and have been removed from RavenDB `7.0`. + -* `ServerOptions`'s `AcceptEula` property is no longer used, +The following properties are no longer in use and have been removed in RavenDB `7.1`. + +* `ServerOptions`'s `AcceptEula` property is no longer used. Please use `Licensing.EulaAccepted` instead. - - -{`// Removed -c bool AcceptEula -`} - - - -* The `MemoryInfoResult` struct no longer includes these classes: - - `MemoryUsageIntervals` - - -{`// Removed -c sealed class MemoryUsageIntervals -`} - - - - `MemoryUsageLowHigh` - - -{`// Removed -c sealed class MemoryUsageLowHigh -`} - - + + ```csharp + // Removed + bool AcceptEula + ``` + + +* The `MemoryInfoResult` struct no longer includes these classes: + + - `MemoryUsageIntervals` + + + ```csharp + // Removed + sealed class MemoryUsageIntervals + ``` + + + - `MemoryUsageLowHigh` + + + ```csharp + // Removed + sealed class MemoryUsageLowHigh + ``` + + + + + +In RavenDB `7.0`: +When combining a vector search with a filtering condition using _AND_, the filter was applied **after** the vector search completed within the _NumberOfCandidates_ limit. +As a result, increasing _NumberOfCandidates_ was often necessary, since the filter could discard many of the retrieved candidates. +In RavenDB `7.1`: +The filter is now integrated into the vector search process. +RavenDB automatically ensures that enough results matching both the vector similarity and the filtering condition are found, without requiring manual adjustments to _NumberOfCandidates_. +Learn more in [How filtered vector search works](../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#how-filtered-vector-search-works). + \ No newline at end of file From 8927fb712b31d1e0f99902ebd6f52fc2d29ce705 Mon Sep 17 00:00:00 2001 From: Danielle9897 Date: Thu, 9 Apr 2026 16:22:19 +0300 Subject: [PATCH 6/6] RDoc-3706 fixed review comments --- .../content/_vector-search-using-dynamic-query-csharp.mdx | 2 +- .../content/_vector-search-using-dynamic-query-nodejs.mdx | 2 +- .../content/_vector-search-using-dynamic-query-python.mdx | 2 +- .../content/_vector-search-using-dynamic-query-csharp.mdx | 2 +- .../content/_vector-search-using-dynamic-query-nodejs.mdx | 2 +- .../content/_vector-search-using-dynamic-query-python.mdx | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-csharp.mdx b/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-csharp.mdx index c8900fa0ed..aee6746197 100644 --- a/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-csharp.mdx +++ b/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-csharp.mdx @@ -1435,7 +1435,7 @@ RavenDB first evaluates the filter to determine how many documents match and the * The requested _number of candidates_ exceeds half the filter match count. Learn about the _number of candidates_ param in [The query parameters](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#the-dynamic-query-parameters). - In this mode, an exact nearest-neighbor search is performed over **only** the documents that match the filter. + In this mode, an exact search is performed over **only** the documents that match the filter. * **Approximate search:** When none of the conditions above apply, RavenDB uses approximate HNSW graph traversal to find the nearest vectors to the search term. diff --git a/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-nodejs.mdx b/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-nodejs.mdx index 085160a01d..9ce5c0d290 100644 --- a/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-nodejs.mdx +++ b/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-nodejs.mdx @@ -982,7 +982,7 @@ RavenDB first evaluates the filter to determine how many documents match and the * The requested _number of candidates_ exceeds half the filter match count. Learn about the _number of candidates_ param in [The query parameters](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#the-dynamic-query-parameters). - In this mode, an exact nearest-neighbor search is performed over **only** the documents that match the filter. + In this mode, an exact search is performed over **only** the documents that match the filter. * **Approximate search:** When none of the conditions above apply, RavenDB uses approximate HNSW graph traversal to find the nearest vectors to the search term. diff --git a/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-python.mdx b/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-python.mdx index 14b68b82e6..dec6b550ed 100644 --- a/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-python.mdx +++ b/docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-python.mdx @@ -840,7 +840,7 @@ RavenDB first evaluates the filter to determine how many documents match and the * The requested _number of candidates_ exceeds half the filter match count. Learn about the _number of candidates_ param in [The query parameters](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#the-dynamic-query-parameters). - In this mode, an exact nearest-neighbor search is performed over **only** the documents that match the filter. + In this mode, an exact search is performed over **only** the documents that match the filter. * **Approximate search:** When none of the conditions above apply, RavenDB uses approximate HNSW graph traversal to find the nearest vectors to the search term. diff --git a/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-csharp.mdx b/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-csharp.mdx index b9cc8e654b..f7adb8ceed 100644 --- a/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-csharp.mdx +++ b/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-csharp.mdx @@ -1435,7 +1435,7 @@ RavenDB first evaluates the filter to determine how many documents match and the * The requested _number of candidates_ exceeds half the filter match count. Learn about the _number of candidates_ param in [The query parameters](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#the-dynamic-query-parameters). - In this mode, an exact nearest-neighbor search is performed over **only** the documents that match the filter. + In this mode, an exact search is performed over **only** the documents that match the filter. * **Approximate search:** When none of the conditions above apply, RavenDB uses approximate HNSW graph traversal to find the nearest vectors to the search term. diff --git a/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-nodejs.mdx b/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-nodejs.mdx index e3bab19b1a..9778f8fe25 100644 --- a/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-nodejs.mdx +++ b/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-nodejs.mdx @@ -982,7 +982,7 @@ RavenDB first evaluates the filter to determine how many documents match and the * The requested _number of candidates_ exceeds half the filter match count. Learn about the _number of candidates_ param in [The query parameters](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#the-dynamic-query-parameters). - In this mode, an exact nearest-neighbor search is performed over **only** the documents that match the filter. + In this mode, an exact search is performed over **only** the documents that match the filter. * **Approximate search:** When none of the conditions above apply, RavenDB uses approximate HNSW graph traversal to find the nearest vectors to the search term. diff --git a/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-python.mdx b/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-python.mdx index 9cd63d7b72..05f41a4669 100644 --- a/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-python.mdx +++ b/versioned_docs/version-7.1/ai-integration/vector-search/content/_vector-search-using-dynamic-query-python.mdx @@ -840,7 +840,7 @@ RavenDB first evaluates the filter to determine how many documents match and the * The requested _number of candidates_ exceeds half the filter match count. Learn about the _number of candidates_ param in [The query parameters](../../../ai-integration/vector-search/vector-search-using-dynamic-query.mdx#the-dynamic-query-parameters). - In this mode, an exact nearest-neighbor search is performed over **only** the documents that match the filter. + In this mode, an exact search is performed over **only** the documents that match the filter. * **Approximate search:** When none of the conditions above apply, RavenDB uses approximate HNSW graph traversal to find the nearest vectors to the search term.