feat(search): make OKF document descriptions full-text searchable
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'sdescriptionfield (withdescription.delimited). - Search V3: joins the shared
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 (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-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.- 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 withsearchAcrossEntitiesby the word and by a phrase.
How I tested it locally:
./gradlew :metadata-io:testfiltered toV3SearchFieldModelTest,V3SearchFieldsTest,MultiEntityMappingsBuilderTest,V2MappingsBuilderTest,SearchDocumentTransformerTest,V3SearchDocumentProjectorTestandSearchQueryBuilderTest: all pass.- Docker-free stack (
scripts/dev/datahub-dev.sh start --local --job smoke-test, Search V3 by default): the new smoke test andtest_okf_reimport.pypass. - On that stack, the live
documentindex_v3mapping hasdescription(text/stemmed) andhasDescription. - Manual negative check on that stack: a marker that appears only in the description is found, and a marker that appears only in
okfProperties.rawis not.
Checklist
- PR title follows the Contributing Guideline
- Tests added/updated
š¤ Opened with cclaude on behalf of @shirshanka