Repository navigation
Fixes #34557: Add a Search Settings toggle to turn column indexing off - #34571
Conversation
Adds globalSettings.enableColumnIndexing (default true) and a toggle in Settings > Preferences > Search Settings. Turning it off stops writing column docs, both live and during reindex, and deletes column_search_index. Turning it on creates the index if it is missing. While it is off, the missing index cannot fail other work: - Startup, CLI and reindex skip it. - Table child fan-out and the Explore entity-type counts leave it out. - Column-only searches return an empty result. Also fixes SearchRepository.deleteIndex for a canonical name that is an alias over a rebuilt index. Elasticsearch reports the alias as existing but rejects a delete through it, so the alias targets are resolved first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
| Count | Rule |
|---|---|
| 2 | react-hooks/exhaustive-deps |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/pages/SearchSettingsPage/SearchSettingsPage.tsx:222:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/pages/SearchSettingsPage/SearchSettingsPage.tsx:477:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'fetchSearchConfig'. Either include it or remove the dependency array. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changedWith column indexing off, the system status "Search Reindex Status" step listed tableColumn as a missing index and asked for a reindex that skips it. Skipping it only there would let the mapping-drift check mark it stale after a release that changes the column mapping. SearchRepository.isIndexDisabled now holds the rule. It is applied next to the vector-index skip in findMissingIndexes and existingTrackedIndexes, and to the /v1/search/stats and search-index metric counts, which walked every mapping the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code Review ✅ Approved🔴 High risk · Disabling column indexing deletes its search index and alters indexing across server paths Adds a Column indexing toggle to Search Settings that allows admins to disable column document indexing, backed by a new 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 |
|
|



Describe your changes:
Fixes #34557
Adds a Column indexing toggle to Settings > Preferences > Search Settings, backed by a new
globalSettings.enableColumnIndexingflag (defaulttrue, so nothing changes until an admin turns it off).column_search_indexis deleted from Elasticsearch/OpenSearch.Type of change:
High-level design:
Source of truth. The flag lives in the search settings.
SettingsCache.isColumnIndexingEnabled()caches it as its own entry next to the aggregated search fields, so the per-table write path doesn't copy all ofSearchSettings(~144 KB) on every call. The entry is invalidated with the search settings.Applying a change.
SystemRepository.postUpdate(SEARCH_SETTINGS)is reached by the PUT, PATCH and reset paths. It callsSearchRepository.reconcileColumnIndex(), which creates the index if missing (with its aliases) while on, and deletes it while off. Server startup runs the same reconcile.deleteIndexfix. After a recreate reindex, the canonicalcolumn_search_indexis an alias overcolumn_search_index_rebuild_<ts>. Elasticsearch answersHEADon an alias with 200 but rejectsDELETEthrough it with a 400.deleteIndexnow resolves alias targets first. Confirmed on ES 9.3.0, and the new IT exercises this exact shape.While off, nothing may trip over the missing index:
DefaultRecreateHandlerdoesn't stage the column index. A staged one left by a run that was turned off mid-flight is dropped instead of promoted. Both bulk sinks skip column tasks, and notableColumnstats slot is added.createMissingIndexes,migrate(updateIndexes) andcreate-indexesskip the column index. The reindex "all" expansion and the entity picker leave outtableColumn.tableColumnalias. Each is one multi-index request, and one missing index would fail the test-case updates too./v1/search/entityTypeCountsleaves the column index out of its explicit index list. Otherwise every Explore search with a query would 404.SEARCH_INDEX_NOT_FOUND.Merge fix.
SearchSettingsHandler.mergeSearchSettingsrebuildsGlobalSettingsfield by field, so it now carries the new flag. Otherwise every save and restart would silently flip it back on.Not in this PR:
Upgrade. No migration is needed. A missing flag deserializes to
true, and the startup merge fills it in.Collate. No change needed.
SearchRepositoryExtonly extendsdeleteOrUpdateChildrenthroughsuper.Tests:
Use cases covered
Unit tests
SettingsCacheColumnIndexingTest(new): cached flag, invalidation, and a fresh install with no settings row logging no error.SearchSettingsHandlerTest: the merge keepsfalseand falls back to the default.SearchRepositoryBehaviorTest: write gating, child-alias filtering, counts and indexed types, empty column-only search and aggregate, reconcile in both directions, startup creation, alias-target delete.DefaultRecreateHandlerTest: column index recreated with tables only while on; a staged column index dropped when turned off.DistributedIndexingStrategyTest: column stats slot only while on.SearchSettingsPage.test.tsx: default on, confirm before off, cancel keeps it on, reindex hint on enable.Backend integration tests
tests/search/ColumnIndexingToggleIT(new, search-it lane): the off/on round trip against a live engine.Playwright (UI) tests
Pages/SearchSettings.spec.ts: the toggle asks for confirmation and stays on when cancelled. It stops at Cancel because confirming would delete the column index that later specs search.Manual testing performed
ColumnIndexingToggleITlocally withmvn verify -P search-itagainst Elasticsearch 9.3.0 and Postgres; it passed. The bootstrap had already run a recreate reindex, so the canonicalopenmetadata_column_search_indexwas an alias. The server log shows the toggle resolving it toopenmetadata_column_search_index_rebuild_<ts>and deleting that index. Turning the toggle back on createdopenmetadata_column_search_indexwith thedataAsset,table,tableColumnandallaliases, and the new table's column doc was indexed into it.search/**,apps/bundles/searchIndex/**, settings and system pass. On the rebased branch the 246 directly related tests pass after a clean build.SearchSettingsPage.test.tsxpasses 6/6.HEADon an alias returns 200, andDELETEthrough it returns 400 (matches an alias, specify the corresponding concrete indices). This is whydeleteIndexresolves alias targets first.UI screen recording / screenshots:
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.🤖 Generated with Claude Code