Repository navigation
fix(search): embed ElasticSearch semantic search queries as queries, not documents - #32553
Conversation
✅ Playwright Results — workflow succeededValidated commit ✅ 944 passed · ❌ 0 failed · 🟡 2 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 50m 31s ⏱️ Max setup 4m 23s · max shard execution 18m 15s · max shard-job elapsed before upload 21m 18s · reporting 5s 🌐 216.08 requests/attempt · 2.39 app boots/UI scenario · 34.89% common-shard skew Optimization targets still in progress:
🟡 2 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
🚦 Removed from the merge queue —
|
Code Review ✅ ApprovedFixes ElasticSearch semantic search to embed queries using OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
…32342) (#32987) * Fix MCP entity patch lifecycle handling (#32226) * fix(mcp): respect entity patch lifecycles * fix(mcp): protect task patch lifecycle * gitarbot feedback: block document, metric, metricGroup patch lifecycles too * reflow lifecycle comment so no entry wraps at the 100-col limit * drop metric and metricGroup entries, reverted upstream by #32333 (cherry picked from commit ac4a26b) * feat(search): report embedding token usage instead of discarding it (#32552) * feat(search): report embedding token usage instead of discarding it * fix(search): report the text the provider received, not the caller's input (cherry picked from commit 2209bd7) * Fixes 30023: apply the caller's policies to bot searches (#32460) * fix(search): apply the caller's policies to bot searches (#30023) * test: poll for the widened bot's own view in the allow-only role IT * test: probe search RBAC on the asset index, not the domain index * test: prove bot search scoping with a deny rule, not domains * gitarbot feedback: include team ids in the RBAC query cache key (cherry picked from commit dda6a92) * fix(search): embed ElasticSearch semantic search queries as queries, not documents (#32553) (cherry picked from commit ce2a1c1) * fix(ingestion): use HTTP transport for MCP connector (#32342) * fix(ingestion): use HTTP transport for MCP connector * Update generated TypeScript types and dereferenced schemas * chore: prune obsolete G004 baseline entries * fix(ingestion): complete MCP HTTP transport support * style(ingestion): format MCP transport client --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> (cherry picked from commit c45f71a) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Closes #32490
ElasticSearchVectorService.searchembeds the user's query withembed(query). The OpenSearch path usesembedQuery(query).That matters for providers that treat the two differently. Cohere on Bedrock picks
search_documentorsearch_querybased on which method is called, so on Elasticsearch we embed questions as if they were documents.Effect
Semantic search ranks worse on Elasticsearch than on OpenSearch with the same data, and nothing in the logs says why.
Fix
Call
embedQuery. One line.Tests
21 pass. The new test was checked by reverting the fix first, and it fails without it.
The existing suite missed this because it stubs
embedand only asserts on the mocked HTTP response, so the query vector was never looked at.