Skip to content

Commit 32c59ed

Browse files
committed
RDoc-3468 Add info about 'InvalidQueryException' to the relevant query examples
1 parent 2830c36 commit 32c59ed

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

docs/ai-integration/vector-search/content/_vector-search-using-dynamic-query-csharp.mdx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,16 @@ where vector.search(embedding.text(Name), "italian food", 0.82, 20)
313313

314314
* The query explicitly specifies the **identifier** of the embeddings generation task that was defined in
315315
[this example](../../../ai-integration/generating-embeddings/embeddings-generation-task.mdx#configuring-an-embeddings-generation-task---from-the-studio).
316-
Results are retrieved by comparing the search term against the pre-made embeddings generated by this task,
317-
which are stored in the [Embedding collections](../../../ai-integration/generating-embeddings/embedding-collections.mdx).
316+
An `InvalidQueryException` will be thrown if no embeddings generation task with the specified identifier exists.
317+
318+
To avoid this error, you can verify that the specified embeddings generation task exists before issuing the query.
319+
Refer to [Get embeddings generation task details](../ai-integration/generating-embeddings/overview#get-embeddings-generation-task-details)
320+
to learn how to programmatically check which tasks are defined
321+
and what their identifiers are.
318322

319-
* To ensure consistent comparisons, the search term is transformed into an embedding using the same embeddings generation task.
323+
* Results are retrieved by comparing the search term against the pre-made embeddings generated by the specified task,
324+
which are stored in the [Embedding collections](../../../ai-integration/generating-embeddings/embedding-collections.mdx).
325+
To ensure consistent comparisons, the search term is transformed into an embedding using the same embeddings generation task.
320326

321327
<Tabs groupId='languageSyntax'>
322328
<TabItem value="Query" label="Query">

docs/ai-integration/vector-search/content/_vector-search-using-static-index-csharp.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1343,11 +1343,17 @@ store.Maintenance.Send(new PutIndexesOperation(indexDefinition));
13431343
</Tabs>
13441344

13451345
Execute a vector search using the index:
1346+
13461347
* Pass a textual search term to the `ByText` method,
13471348
along with the ID of the embedding generation task that will convert the text into an embedding.
1349+
13481350
* The query is only meaningful if the vector field being searched contains numerical embeddings
13491351
generated using the same model as the one configured in the specified task.
1350-
* If the specified task ID is not found, RavenDB will throw an `InvalidQueryException`.
1352+
1353+
* If the specified task ID is not found, RavenDB will throw an `InvalidQueryException`.
1354+
To avoid this error, you can verify that the specified embeddings generation task exists before issuing the query.
1355+
See [Get embeddings generation task details](../ai-integration/generating-embeddings/overview#get-embeddings-generation-task-details)
1356+
to learn how to check which tasks are defined and what their identifiers are.
13511357

13521358
<Tabs groupId='languageSyntax'>
13531359
<TabItem value="Query" label="Query">

0 commit comments

Comments
 (0)