Repository navigation
[2.0] Fixes #36463: restore context search on Elasticsearch - #37041
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved🟡 Medium risk · Using the repository vector service for AI and company-context searches enables Elasticsearch results; service differences could surface incomplete or unintended context. Backports the Elasticsearch context lookup fix so VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Fixes #36463
Backport of #36548, cherry-picked from
961fb5f9200d4159c266303fccd9e6f86406097b.On Elasticsearch,
find_contextreturned no knowledge andcompany_contextreported that semantic search was disabled because both read the OpenSearch-only singleton. Both now obtainVectorIndexServicethroughSearchRepository.getVectorIndexService(). OpenSearch retains its existing implementation, and company-context searches still receive the caller'sSubjectContextfor memory visibility.The only backport adaptation was resolving imports against the existing
2.0finder and tests. The diff contains the same two production changes and their regression tests.Type of change:
High-level design:
Not applicable — small backport that reuses the existing backend-neutral vector-service accessor. No schema, migration, API contract, or configuration changes.
Tests:
Use cases covered
Unit tests
28 tests passed, zero failures or skips:
AIContextFinderTest: 9AIContextFinderAccessTest: 2CompanyContextToolTest: 17Command:
JaCoCo covers both changed executable lines (2/2). Whole-class line coverage is 83.5% for
AIContextFinder(111/133) and 88.8% forCompanyContextTool(103/116), below the 90% target; the uncovered lines belong to existing routing, lookup, and error paths outside this backport.Backend integration tests
42 tests passed against MySQL and Elasticsearch, zero failures or skips:
AIContextKnowledgeAuthorizationIT: 1AIContextRestIT: 6AIContextMcpIT: 6McpContextMemoryPrincipalIdentityIT: 3McpContextMemoryVisibilityIT: 4McpToolsValidationIT: 22Command:
The
2.0branch does not containmake java_affectedor the Java impact map, so the relevant existing tests were selected and run directly. These are the backport's results; the original PR's results are not reused here.Ingestion integration tests
Not applicable — no ingestion changes.
Playwright (UI) tests
Not applicable — no UI changes.
Manual testing performed
Compared the backport with the merged source patch and checked compatibility with
2.0's vector-service overloads and visibility filtering. No live embedding-provider test was repeated on2.0; #36548 contains the original Elasticsearch before/after verification.UI screen recording / screenshots:
Not applicable — backend-only fix.
Checklist:
mvn -B -pl openmetadata-service,openmetadata-mcp spotless:applypassed.acb32478e6a7367e8e027c9592624eeb9d78435bagainstREVIEW.md, including the Elasticsearch implementation and caller visibility; no important findings.