Skip to content

fix(search): route column search through the structured builder so counts match results (#31106) [2.0 backport] - #31208

Merged
mohityadav766 merged 1 commit into
2.0from
cherry-pick-31106-to-2.0
Aug 7, 2026
Merged

mohityadav766 merged 1 commit into
2.0from
cherry-pick-31106-to-2.0

Conversation

@mohityadav766

Copy link
Copy Markdown
Member

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=tableColumn results were built by buildColumnSearchBuilderV2 — a permissive multi_match (best_fields, operator: OR) that does not search fqnParts. 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 the dataAsset aggregation that backs the tab count uses the structured builder (operator: AND over fqnParts) and correctly returns 1.

Fix: route column indexes through buildDataAssetSearchBuilderV2 (like table does) so they use the existing tableColumn AssetTypeConfiguration, which already has fqnParts + structured match types. 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. The now-unused buildColumnSearchBuilderV2 is removed from both engine factories.

Backport notes:

  • Clean cherry-pick (-x) — all four files were byte-identical to the parent of the main commit, so the patch applied verbatim with no conflicts and no adaptation (unlike the 1.13 backport).

Type of change:

  • Bug fix

Tests:

  • SearchSourceBuilderFactoryTest#testColumnIndexUsesStructuredDataAssetBuilder — index=tableColumn now emits a query carrying fqnParts + "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

…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)
@mohityadav766
mohityadav766 requested a review from a team as a code owner August 7, 2026 17:11
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • Linked issue open-metadata/openmetadata-collate#3851 does not exist or is not accessible.

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 skip-pr-checks label.

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Aug 7, 2026
@gitar-bot

gitar-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Routes column search through the structured asset builder to align search counts with results and removes the unused column search builder. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 524170ad168be4c802055812e34049ddffedbf92 in Playwright run 31201144495, attempt 1.

✅ 1025 passed · ❌ 0 failed · 🟡 1 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking 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:

  • Common shard skew was 19.73% (convergence target: at most 15%).
  • Application boot ratio was 2.21 per UI scenario (2310 boots / 1043 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 146 0 0 0 0 0
✅ Shard chromium-02 143 0 0 0 0 0
✅ Shard chromium-03 140 0 0 0 0 0
✅ Shard chromium-04 131 0 0 0 0 0
🟡 Shard chromium-05 145 0 1 0 0 0
✅ Shard chromium-06 141 0 0 0 0 0
✅ Shard data-asset-rules-01 61 0 0 0 0 0
✅ Shard domain-isolation-01 14 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard ingestion-01 2 0 0 0 0 0
✅ Shard reindex-01 28 0 0 0 0 0
✅ Shard search-01 11 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 1 flaky test(s) (passed on retry)
  • Features/SearchExport.spec.ts › Export queues a background job and downloads from the jobs tray (shard chromium-05, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@mohityadav766
mohityadav766 merged commit 53fa127 into 2.0 Aug 7, 2026
97 of 106 checks passed
@mohityadav766
mohityadav766 deleted the cherry-pick-31106-to-2.0 branch August 7, 2026 19:53

This branch was previously deployed

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

Labels

backend safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant