Repository navigation
feat(search): make OKF document descriptions full-text searchable - #21877
Conversation
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.
PR SummaryOverview The change is schema-only: Reindexing is required for existing documents (e.g. RestoreIndices for Reviewed by Cursor Bugbot for commit e3532ce. Bugbot is set up for automated code reviews on this repo. Configure here. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
All reported issues were addressed
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Smart test selectionpytest smoke testsMode: active. Only the selection below runs for the pytest smoke tests on this PR (applied:
Selected scopes (45 files or classes, 204 tests)
Add the Playwright E2E testsThis run:
Specs selected because of this PR (18)
Add the commit |
…ra_aspects in smoke test
There was a problem hiding this comment.
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
…iption as a ranking boost
What
A search for a phrase from an OKF document's frontmatter
descriptionnow finds that document, on Search V2 and Search V3.The description was stored only in
okfProperties.description, which had no@Searchableannotation, and documents have no other description field. This PR annotates it the way other assets' descriptions are annotated (for exampledatasetProperties.description):TEXT, queried by default, default boost, indexed as the document'sdescriptionfield (withdescription.delimited).descriptionlabel (keyword not indexed,textandstemmedsubfields), queried by default.hasDescription: set when a document has a description. The registry validator requires every field on the shared V3descriptionlabel to declare the samehasValuesFieldName, 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(oraspectNames=okfProperties). Documents with a description also gethasDescription, so on an empty (*) search they get the same ranking boost as other described assets.The
okfPropertiesschemaVersionis bumped to 2, and the search template golden (field-manifest.json) now listsdescriptionamong the document's V3 query fields.Tests
V3SearchFieldsTest: the document entity's V3 full-textdescriptionfield now has the OKF description as its source.V3SearchFieldModelTest: the document index group now supports full-textdescription. The negative case moves todataHubIngestionSource, which has no description.SearchQueryBuilderTest: the document's V2 default query fields includedescriptionanddescription.delimited.smoke-test/tests/e2e/knowledge/test_okf_search.py: writes an OKF document whose marker word appears only in its description, then finds it withsearchAcrossEntitiesby the word and by a phrase.How I tested it locally:
./gradlew :metadata-io:testfiltered toV3SearchFieldModelTest,V3SearchFieldsTest,MultiEntityMappingsBuilderTest,V2MappingsBuilderTest,SearchDocumentTransformerTest,V3SearchDocumentProjectorTestandSearchQueryBuilderTest: all pass.scripts/dev/datahub-dev.sh start --local --job smoke-test, Search V3 by default): the new smoke test andtest_okf_reimport.pypass.documentindex_v3mapping hasdescription(text/stemmed) andhasDescription.okfProperties.rawis not.Checklist
🤖 Opened with cclaude on behalf of @shirshanka