Conversation
Contributor
Greptile SummaryFixed OpenSearch to use
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Chunk as DocMetadataAwareIndexChunk
participant Embedder as DefaultIndexingEmbedder
participant EnrichFunc as generate_enriched_content_for_chunk_embedding
participant OpenSearch as opensearch_document_index
participant TextEnrichFunc as generate_enriched_content_for_chunk_text
participant Doc as Document
Note over Embedder,EnrichFunc: Content Embedding Flow
Embedder->>EnrichFunc: Call with DocAwareChunk
EnrichFunc-->>Embedder: Return enriched content (with metadata_suffix_semantic)
Embedder->>Doc: get_title_for_document_index()
Doc-->>Embedder: Return title (or semantic_identifier if title is None)
Note over OpenSearch,TextEnrichFunc: OpenSearch Indexing Flow
OpenSearch->>Doc: get_title_for_document_index()
Note right of OpenSearch: Fixed: Now uses same<br/>method as embedder
Doc-->>OpenSearch: Return consistent title
OpenSearch->>TextEnrichFunc: Call with DocMetadataAwareIndexChunk
TextEnrichFunc-->>OpenSearch: Return enriched content (with metadata_suffix_keyword)
|
evan-onyx
approved these changes
Jan 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
_index_vespa_chunkusesget_title_for_document_index()to populate the title field in a document index entry, which also happens to be same data used to create a title embedding. The OpenSearch flow needs to use this too.This PR also encapsulates the enrichment logic for creating a content embedding in a similar way that content text enrichment logic is encapsulated in
backend/onyx/document_index/chunk_content_enrichment.py.How Has This Been Tested?
@evan-onyx first wrote this title fix in https://github.com/onyx-dot-app/onyx/pull/7560/changes#diff-d09eebe79e128bf021e791c21a4ff9cf98d85d79e4da36b237885de09bbd5618 and it works.
Additional Options
Summary by cubic
Use get_title_for_document_index in OpenSearch so the stored title matches the title used for embeddings and corrects fallback behavior. Also add a helper for content-embedding enrichment and rename the text-enrichment helper for clarity.
Bug Fixes
Refactors
Written for commit f786e38. Summary will update on new commits.