Skip to content

RDoc-4007/4172/4170/4164 Vector search highlighting - #2744

Open
Danielle9897 wants to merge 14 commits into
ravendb:mainfrom
Danielle9897:RDoc-4007-vector-search-highlight
Open

Danielle9897 wants to merge 14 commits into
ravendb:mainfrom
Danielle9897:RDoc-4007-vector-search-highlight

Conversation

@Danielle9897

@Danielle9897 Danielle9897 commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Issue link


Additional description

  • Documentation reorganization:

    • Vector search
      Added dedicated articles: More Querying Options, Quantization, & Vector search configuration.
      Moved related material out of the dynamic-query and static-index articles.
    • Embeddings generation
      Added dedicated articles: Chunking and Context Prefixes & Embeddings generation configuration.
      Added a section about "updating an existing embeddings generation task".
  • New feature - Retrieve matching chunk text in vector search:
    When the embeddings generation task stores chunk text,
    a vector search by text can return the matching chunks of each result as highlight fragments.

    • Article More Querying Options shows how to retrieve the chunks with include highlight(...)
      in both dynamic queries and static-index queries.
    • The Embeddings Generation Task article explains how to enable StoreChunkText
      and reprocess documents the task has already handled.
  • Language updates:

    • Java: added articles.
    • C#, Java, Node.js, and Python: updated examples, wording, and links.

C# @maciejaszyk pls review the *-csharp.mdx files
Python @poissoncorp pls review the *-python.mdx files
Java @LielNagar pls review the *-java.mdx files
Node.js @M4xymm pls review the *-nodejs.mdx files


Type of change

  • Content - docs
  • Content - cloud
  • Content - Quill
  • Content - guides
  • Content - start pages/other
  • New docs feature (consider updating /templates or readme)
  • Bug fix
  • Optimization
  • Other

Changes in docs URLs

  • No changes in docs URLs
  • Articles are restructured, URLs will change, mapping is required (update /scripts/redirects.json file, set Documents Moved PR label)

Changes in UX/UI

  • No changes in UX/UI
  • Changes in UX/UI (include screenshots and description)

collection; // string
embeddingsPathConfigurations; // EmbeddingPathConfiguration[]
embeddingsTransformation; // EmbeddingsTransformation
quantization; // VectorEmbeddingType

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old note that quantization can't be "Text" got dropped, and the client rejects it ("Quantization cannot be Text"). Maybe:

Suggested change
quantization; // VectorEmbeddingType
quantization; // VectorEmbeddingType: "Single" | "Int8" | "Binary" (not "Text"), default: "Single"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

</Admonition>
**Chunking method syntax for the JavaScript scripts**:
// Store the text of each chunk in the embeddings document
employeeNotesTaskConfiguration.storeChunkText = true;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reprocess section below says to assume this task was created with storeChunkText = false, but it reuses this same config object, which sets it to true. Either set it to false here or say there that this sample shows the end state.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept storeChunkText = true in the "Store chunk text" example and changed the reprocess example to use the GetEmbeddingsFromOpenAI task from the PATHS example, which is created with storeChunkText = false.

The example now updates that task's configuration object (embeddingsTaskConfiguration),
the same way the "Modify the task" example does, so the premise matches the code.
I made the same task change in the C#, Java and Python versions, whose reprocess intro had the same contradiction.

Note:
the C#, Java and Python examples read the task's current configuration from the server and update it.
That doesn't work in Node.js: GetOngoingTaskInfoOperation returns the configuration as a plain object, not an EmbeddingsGenerationConfiguration, so it can't be passed to UpdateEmbeddingsGenerationOperation.
Looks like a client gap.

* **Regenerate embeddings for all documents**:
This toggle appears only when editing a task.
If it is ON when you save the task, the task processes all documents in its collection again,
the same as resetting the task with `ResetEtlOperation` in the [Client API](#modify-the-task---from-the-client-api).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ResetEtlOperation example is under Reprocess existing documents, so I think this link should be #reprocess-existing-documents.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

connectionString.identifier = 'id-for-open-ai-connection-string';
// Connection string name & identifier
connectionString.name = "ConnectionStringToOpenAI";
connectionString.identifier = "id-for-open-ai-connection-string";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modelType is never set here. The client tests always set it for embeddings connection strings, so I'd add it:

Suggested change
connectionString.identifier = "id-for-open-ai-connection-string";
connectionString.identifier = "id-for-open-ai-connection-string";
connectionString.modelType = "TextEmbeddings";

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

// Default is 0
overlapTokens, // number

chunkingMethod, // ChunkingMethod, default: "PlainTextSplit"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small one: in Node ChunkingOptions is a plain interface, so these values aren't client defaults. The server applies them when a field is omitted. Maybe "default (server): ..."?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

const dbRecord = await documentStore.maintenance.server.send(getDatabaseRecordOp);

// Access the list of embeddings generation tasks
const tasks = dbRecord.embeddingsGenerations;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

embeddingsGenerations is optional on the record type, so tasks.length can throw when there are no tasks.

Suggested change
const tasks = dbRecord.embeddingsGenerations;
const tasks = dbRecord.embeddingsGenerations ?? [];

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants