Conversation
A Contains filter on description compiles to a phrase query, which needs token positions in the inverted index. Five shipped mappings set index_options below the Elasticsearch default for a text field: en/glossary_term_search_index docs ru/glossary_term_search_index docs jp/metric_search_index docs zh/api_endpoint_search_index freqs zh/metric_search_index docs docs stores neither frequencies nor positions and freqs stores no positions, so on those indexes the query matches nothing - no error, no warning, just zero hits. Three of the five also declare term_vector: with_positions_offsets, which asks for positions while index_options strips them. The guard is a property test rather than a list of five files: IndexAnalyzerMappingTest#dataAssetDescriptionsSupportPhraseQueries walks every index carrying the dataAsset parent alias, in all four languages, and names the offenders. On main it reports exactly these five. Mapping files are hashed by IndexMappingVersionTracker, so the affected indexes are flagged for reindex automatically; existing deployments need that reindex before descriptions become searchable by phrase. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
Code Review ✅ Approved🟡 Medium risk Fixes phrase query support on description fields by correcting 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 #33542. Salvaged from the closed PR #33248 (tracking: #33528).
A
Containsfilter on description silently returns nothing on five search indexes — no error, nowarning, just zero hits. A
Containsfilter compiles to a phrase query, and a phrase query needstoken positions in the inverted index. Elasticsearch's default
index_optionsfor atextfieldis
positions; these five mappings explicitly downgrade it below that:en/glossary_term_search_indexdocspositionsru/glossary_term_search_indexdocspositionsjp/metric_search_indexdocspositionszh/api_endpoint_search_indexfreqspositionszh/metric_search_indexdocspositionsdocsstores neither frequencies nor positions;freqsstores frequencies but no positions. Eitherway the phrase query has nothing to match against.
Three of the five compound the contradiction by also declaring
"term_vector": "with_positions_offsets"— asking for positions in the term vector whileindex_optionsstrips themfrom the index. The mapping blocks are authored by copying an existing entity's file, which is how a
setting like this reaches some entities and not others.
⚠ Reindex required.
IndexMappingVersionTrackerhashes each mapping file, so the affectedindexes are flagged for reindex automatically — but an existing deployment needs that reindex to run
before descriptions become searchable by phrase.
Type of change:
High-level design:
Five one-line mapping changes. The interesting choice is the guard: rather than a test that asserts
"these five files are correct",
dataAssetDescriptionsSupportPhraseQueriesis a property testover every index carrying the
dataAssetparent alias, in all four languages, that fails naming anyoffender. A sixth entity added later by copying one of these files is caught by the same test instead
of needing this issue filed again.
Tests:
Use cases covered
positionsare unaffected.Unit tests
IndexAnalyzerMappingTest#dataAssetDescriptionsSupportPhraseQueries— new, and fails onmainnaming exactly the five indexes this PR fixes:
After the change the class is 6/6 green, the 5 pre-existing analyzer-chain tests included.
Backend integration tests
Not applicable — no API change. Behaviour is in the shipped index mappings.
Ingestion integration tests
Not applicable.
Playwright (UI) tests
Not applicable — no UI change.
Manual testing performed
main— it named the five indexes above.mvn -pl openmetadata-spec install -DskipTeststhenmvn -pl openmetadata-service test -Dtest=IndexAnalyzerMappingTest— 6 tests, BUILD SUCCESS.(The service test reads mappings from the spec jar, so the spec module has to be reinstalled or
the run silently uses the old mappings.)
mappings.properties.descriptionin each file andnot on a nested one — the diff is exactly 5 files, 1 line each.
mvn spotless:apply -pl openmetadata-service— clean.UI screen recording / screenshots:
Not applicable.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #33542.🤖 Generated with Claude Code
The PR appears safe to merge, with the mapping changes and regression test consistently enforcing phrase-query support.
Summary
Updates five localized Elasticsearch mappings so description fields retain token positions required by phrase-based
Containsfilters.docsorfreqstopositions.Reviews (5) · Last reviewed commit: "Merge branch 'main' into harshach/fix-de..."