Repository navigation
Fixes #34369: send NLQ fallback and aggregate text through the search builder - #34383
Conversation
Code Review ✅ Approved🔴 High risk · NLQ fallback now applies visibility filters, changing users’ searchable entities. Fixes the OptionsDisplay: compact → Counting what did not apply, without listing it. 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 ✅ 4655 passed · ❌ 0 failed · 🟡 3 flaky · ⏭️ 1 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) 38m 48s ⏱️ Max setup 7m 2s · max shard execution 20m 33s · max shard-job elapsed before upload 24m 38s · reporting 15s 🌐 224.82 requests/attempt · 2.21 app boots/UI scenario · 42.50% common-shard skew Optimization targets still in progress:
🟡 3 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 |
Fixes #34369
Problem
Two search endpoints send the user's text to OpenSearch as a
query_stringwithout a field list:/v1/search/nlq/querywhen the question cannot be translated), and/v1/search/aggregatewhenqis plain text.OpenSearch then searches all 229 fields of the table index, including
.ngramsubfields that cut each word into every 3 to 20 character piece. A single 21-character word needs more than 1024 clauses, OpenSearch's default limit, so the request fails withtoo_many_nested_clauses: a 500 on the table index, or a 200 with the table shards silently missing on thedataAssetandallaliases.Why it happened now
Table aliases (#33415 on 2.0, #31829 on main) added one more
.ngramfield to the table mapping, which pushed ordinary inputs over the limit. Full analysis in #34369.What this PR changes
/v1/search/query. It gets the configured fields and boosts from Search Settings, the existing clause budget, and the request's filters./v1/search/aggregatebuilds plain-textqwith the same search-settings builder it already uses forqueryText, on data-asset indexes,allanddataAsset. JSON queries,*, a blankqand other indexes keep today's behaviour.What users will notice
qnow needs all words to match, like/v1/search/query. The UI is unaffected: it sends search text asqueryTextand filters as JSON.query_filter,post_filter, sort and paging, which it used to ignore. Visibility rules passed throughquery_filternow apply to it too.How it was tested
q,*, blankq, field-qualified filters such asfullyQualifiedName:"...", and non data-asset indexes.SearchFieldlessQueryITsends 21 and 40 character tokens to both endpoints ontable_search_indexanddataAsset, on OpenSearch at the default clause limit. Without this change both tests fail with the sametoo_many_nested_clauseserror as the nightly; with it they pass. Longer tokens are covered by Bound the clause cost of every search path #34380.SearchRelevancyITfailures without this change; with it all 14 tests pass, and the whole Collate search package passes on 2.0 and main once the test below is gated.Merge order
Merge after open-metadata/openmetadata-collate#7039: a Collate test assumed any NLQ answer containing its table came from a translation, which the fallback now breaks.
Not in this PR
Bounding the cost of every other search path (search-time analysis of
.ngramfields, very long tokens, string filters, a clause-budget test for every index) is tracked in #34380.