Repository navigation
fix(search): route column search through the structured builder so counts match results (#31106) [2.0 backport] - #31208
Conversation
…unts match results (#31106) index=tableColumn (the Explore Columns tab) went through buildColumnSearchBuilderV2, a permissive multi_match (best_fields, operator OR) that omitted fqnParts. An FQN query therefore OR-matched every column sharing a parent-name token and returned the whole column index (e.g. 7381), while the dataAsset aggregation that backs the tab count uses the structured builder (operator AND over fqnParts) and correctly returns 1. Route column indexes through buildDataAssetSearchBuilderV2 so they use the existing "tableColumn" AssetTypeConfiguration (fqnParts + AND): an FQN search now matches the one column precisely (count == results) and column-name search still works via the config's name/name.ngram fields. Removes the now-unused buildColumnSearchBuilderV2 from both engine factories. Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]> (cherry picked from commit f6d0eb4)
❌ 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 ✅ ApprovedRoutes column search through the structured asset builder to align search counts with results and removes the unused column search builder. No issues found. 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 |
✅ Playwright Results — workflow succeededValidated commit ✅ 1025 passed · ❌ 0 failed · 🟡 1 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) 53m 26s ⏱️ Max setup 2m 57s · max shard execution 17m 4s · max shard-job elapsed before upload 22m 16s · reporting 6s 🌐 186.85 requests/attempt · 2.21 app boots/UI scenario · 19.73% common-shard skew Optimization targets still in progress:
🟡 1 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 |
Backport of #31106 to
2.0.Describe your changes:
Fixes open-metadata/openmetadata-collate#3851 on the 2.0 line.
The Explore Columns tab shows a count of 1 but the results list shows 7,381. Root cause:
index=tableColumnresults were built bybuildColumnSearchBuilderV2— a permissivemulti_match(best_fields,operator: OR) that does not searchfqnParts. An FQN query therefore OR-matched every column that shares a parent-name token (service/db/schema/table) and returned the whole column index, while thedataAssetaggregation that backs the tab count uses the structured builder (operator: ANDoverfqnParts) and correctly returns 1.Fix: route column indexes through
buildDataAssetSearchBuilderV2(liketabledoes) so they use the existingtableColumnAssetTypeConfiguration, which already hasfqnParts+ structured match types. An FQN search now matches the one column precisely (count == results), and column-name search still works via the config'sname/name.ngramfields. The now-unusedbuildColumnSearchBuilderV2is removed from both engine factories.Backport notes:
-x) — all four files were byte-identical to the parent of themaincommit, so the patch applied verbatim with no conflicts and no adaptation (unlike the 1.13 backport).Type of change:
Tests:
SearchSourceBuilderFactoryTest#testColumnIndexUsesStructuredDataAssetBuilder—index=tableColumnnow emits a query carryingfqnParts+"operator":"and"(OpenSearch and Elasticsearch). Verified locally:Tests run: 18, Failures: 0, Errors: 0.ColumnSearchIndexIT#testColumnFqnSearchIsPrecise— against real OpenSearch, searching a column's full FQN returns exactly that column (total == 1). Compile-verified locally; runs in CI against the Docker/OpenSearch stack.🤖 Generated with Claude Code