Skip to content

feat(search): make OKF document descriptions full-text searchable - #21877

Merged
shirshanka merged 6 commits into
masterfrom
okf-searchable-description
Dec 4, 2026
Merged

shirshanka merged 6 commits into
masterfrom
okf-searchable-description

Conversation

@shirshanka

@shirshanka shirshanka commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

What

A search for a phrase from an OKF document's frontmatter description now finds that document, on Search V2 and Search V3.

The description was stored only in okfProperties.description, which had no @Searchable annotation, and documents have no other description field. This PR annotates it the way other assets' descriptions are annotated (for example datasetProperties.description):

  • Search V2: TEXT, queried by default, default boost, indexed as the document's description field (with description.delimited).
  • Search V3: joins the shared description label (keyword not indexed, text and stemmed subfields), queried by default.
  • hasDescription: set when a document has a description. The registry validator requires every field on the shared V3 description label to declare the same hasValuesFieldName, so this is needed, not optional.

No UI or ingestion code changes. The GitHub documents source docs now say the description is searchable.

Upgrade

The new fields are added to the existing mappings, so no reindex is needed. Documents written before the upgrade can't be found by their description until they're written again. To make them searchable right away, run RestoreIndices for document (or aspectNames=okfProperties). Documents with a description also get hasDescription, so on an empty (*) search they get the same ranking boost as other described assets.

The okfProperties schemaVersion is bumped to 2, and the search template golden (field-manifest.json) now lists description among the document's V3 query fields.

Tests

  • V3SearchFieldsTest: the document entity's V3 full-text description field now has the OKF description as its source.
  • V3SearchFieldModelTest: the document index group now supports full-text description. The negative case moves to dataHubIngestionSource, which has no description.
  • SearchQueryBuilderTest: the document's V2 default query fields include description and description.delimited.
  • New smoke test smoke-test/tests/e2e/knowledge/test_okf_search.py: writes an OKF document whose marker word appears only in its description, then finds it with searchAcrossEntities by the word and by a phrase.

How I tested it locally:

  • ./gradlew :metadata-io:test filtered to V3SearchFieldModelTest, V3SearchFieldsTest, MultiEntityMappingsBuilderTest, V2MappingsBuilderTest, SearchDocumentTransformerTest, V3SearchDocumentProjectorTest and SearchQueryBuilderTest: all pass.
  • Docker-free stack (scripts/dev/datahub-dev.sh start --local --job smoke-test, Search V3 by default): the new smoke test and test_okf_reimport.py pass.
  • On that stack, the live documentindex_v3 mapping has description (text/stemmed) and hasDescription.
  • Manual negative check on that stack: a marker that appears only in the description is found, and a marker that appears only in okfProperties.raw is not.

Checklist

  • PR title follows the Contributing Guideline
  • Tests added/updated

🤖 Opened with cclaude on behalf of @shirshanka

The description from an OKF document's frontmatter was stored only in
okfProperties.description, which was not searchable. Annotate it like
other assets' descriptions: TEXT and queried by default on Search V2, and
mapped to the shared description label on Search V3, with hasDescription.
@github-actions github-actions Bot added docs Issues and Improvements to docs product PR or Issue related to the DataHub UI/UX smoke_test Contains changes related to smoke tests labels Dec 4, 2026
@cursor

cursor Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

PR Summary

Overview
OKF frontmatter description on documents is now indexed and included in default full-text search (Search V2 and V3), matching how other entity types expose description.

The change is schema-only: okfProperties.description gets @Searchable annotations (V2 TEXT with description / description.delimited, V3 shared description label with text/stemmed, hasDescription, default query), and the okfProperties aspect schemaVersion bumps to 2. Unit tests, the document search field golden manifest, and GitHub OKF ingestion docs are updated accordingly. A new smoke test proves documents are findable by text that appears only in the OKF description.

Reindexing is required for existing documents (e.g. RestoreIndices for document / okfProperties) before older OKF descriptions become searchable.

Reviewed by Cursor Bugbot for commit e3532ce. Bugbot is set up for automated code reviews on this repo. Configure here.

@cclaude-datahub-project cclaude-datahub-project Bot added the cclaude Opened from a cclaude box label Dec 4, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@codecov

codecov Bot commented Dec 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Smart test selection

pytest smoke tests

Mode: active. Only the selection below runs for the pytest smoke tests on this PR (applied: smart).

  • Selection: smart: tests for the tagged features, plus always-run modules, this PR's changed tests, and the plumbing sample if the PR changes the pytest harness
  • Size: 204 of 860 tests in 1 batch, predicted longest batch ~4 min
  • Tags: change-type: docs; feature-dev: entity-registry, schema-translation, search-indexing; feature-user: documentation, search; technical-layer: elasticsearch, openapi
  • Confidence: HIGH (7 changed files)
  • Classifier reasoning: Changes adjust V3 search field modeling and mappings for the OKF document description (OkfProperties.pdl searchable annotation, golden manifest, search tests), plus a new e2e search smoke test and a docs update for full-text description search.
Selected scopes (45 files or classes, 204 tests)
  • tests/e2e/actions/doc_propagation/test_propagation.py
  • tests/e2e/authorization/test_self_entity_auth.py
  • tests/e2e/browse/browse_test.py
  • tests/e2e/cli/migrate_cmd/test_migrate_instance2instance_smoke.py
  • tests/e2e/cli/migrate_cmd/test_migrate_scenarios_smoke.py
  • tests/e2e/cli/search_cmd/test_search_cmd.py::TestSearchBasic
  • tests/e2e/cli/search_cmd/test_search_cmd.py::TestSearchDiagnose
  • tests/e2e/cli/search_cmd/test_search_cmd.py::TestSearchDryRun
  • tests/e2e/cli/search_cmd/test_search_cmd.py::TestSearchErrorHandling
  • tests/e2e/cli/search_cmd/test_search_cmd.py::TestSearchFilterCombinations
  • tests/e2e/cli/search_cmd/test_search_cmd.py::TestSearchFiltersByEntityType
  • tests/e2e/cli/search_cmd/test_search_cmd.py::TestSearchFiltersByPlatform
  • tests/e2e/cli/search_cmd/test_search_cmd.py::TestSearchPagination
  • tests/e2e/cli/search_cmd/test_search_cmd.py::TestSearchProjectionLive
  • tests/e2e/cli/search_cmd/test_search_cmd.py::TestSearchWhereFilter
  • tests/e2e/delete/delete_assertion_cascade_test.py
  • tests/e2e/frontend/test_static_asset_encodings.py
  • tests/e2e/institutional_memory/institutional_memory_test.py
  • tests/e2e/knowledge/document_change_history_test.py
  • tests/e2e/knowledge/document_search_filter_test.py
  • tests/e2e/knowledge/test_document_crud.py::TestDocumentCrudAndMutations
  • tests/e2e/knowledge/test_document_hierarchy_settings.py::TestDocumentHierarchyAndSettings
  • tests/e2e/knowledge/test_document_search_history.py::TestDocumentSearchAndHistory
  • tests/e2e/knowledge/test_okf_reimport.py
  • tests/e2e/knowledge/test_okf_search.py
  • tests/e2e/managed_ingestion/ingestion_source_run_events_test.py
  • tests/e2e/mcp/mcp_test.py
  • tests/e2e/query_projection/test_query_projection_smoke.py
  • tests/e2e/read_only/test_search.py
  • tests/e2e/read_only/test_services_up.py
  • tests/e2e/restli/restli_test.py
  • tests/e2e/restli/test_restli_batch_ingestion.py
  • tests/e2e/search/test_lineage_search_index_fields.py
  • tests/e2e/search/test_search_projection.py::TestSearchProjection
  • tests/e2e/semantic/test_classical_embedding_provider.py::TestClassicalEmbeddingProvider
  • tests/e2e/semantic/test_config_fingerprint.py::TestConfigFingerprint
  • tests/e2e/semantic/test_current_offset_api.py
  • tests/e2e/semantic/test_event_driven_docs.py::TestEventDrivenDocumentIngestion
  • tests/e2e/semantic/test_event_mode_fallback.py::TestEventModeFallback
  • tests/e2e/semantic/test_local_embedding_provider.py::TestLocalEmbeddingProvider
  • tests/e2e/semantic/test_semantic_search.py::TestSemanticSearchWithIngestion
  • tests/e2e/semantic/test_source_type_filtering.py::TestSourceTypeFiltering
  • tests/e2e/semantic/test_stateful_ingestion.py::TestStatefulIngestion
  • tests/e2e/siblings/siblings_search_batching_test.py
  • tests/e2e/test_e2e.py

Add the run-all-tests:pytest label to run the full pytest suite on this PR.

Playwright E2E tests

This run: smart

  • Selection: smart: specs tagged documentation, entity-registry, schema-translation, search, search-indexing plus the tests the change affects
  • Size: 87 tests in 18 spec files, ~19 min predicted on 3 shard(s)
Specs selected because of this PR (18)
Spec Tests Why
autocomplete-v2/autocomplete.spec.ts 2/2 tagged search
browse-v2/browse-v2.spec.ts 10/10 tagged search
documents/document-import.spec.ts 3/3 tagged documentation
documents/document-management.spec.ts 11/11 tagged documentation
documents/document-tree-expand.spec.ts 2/2 tagged documentation
documents/external-document-profile.spec.ts 1/1 tagged documentation
entity-pages/summary-tab/v2-dataset-summary-about-section.spec.ts 2/2 tagged documentation
entity-pages/summary-tab/v2-summary-tab-about-section.spec.ts 2/2 tagged documentation
logical-models/physical-children-view.spec.ts 2/2 tagged search
mutations-v2/v2-edit-documentation.spec.ts 7/7 tagged documentation
mutations/edit-documentation.spec.ts 1/1 tagged documentation
schema-scale/schema-scale.spec.ts 2/2 tagged documentation
search/query-and-filter-search.spec.ts 10/10 tagged search
search/search-filters.spec.ts 5/5 tagged search
search/search-within-operator.spec.ts 1/1 tagged search
search/search.spec.ts 7/7 tagged search
search/searchv2.spec.ts 15/15 tagged search
upload-files/upload-files.spec.ts 4/4 tagged documentation

Add the run-all-tests:playwright label to run the full Playwright suite on this PR.

commit e3532ce · workflow run

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread docs/how/breaking-changes.md Resolved
@shirshanka
shirshanka enabled auto-merge (squash) December 4, 2026 05:56
@shirshanka
shirshanka merged commit 5279454 into master Dec 4, 2026
113 checks passed
@shirshanka
shirshanka deleted the okf-searchable-description branch December 4, 2026 06:08

This branch was successfully deployed

1 active deployment
Preview — e3532ce2 Deployed Dec 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cclaude Opened from a cclaude box docs Issues and Improvements to docs product PR or Issue related to the DataHub UI/UX smoke_test Contains changes related to smoke tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants