Repository navigation
Fixes #33456: align glossary synonym mappings - #34052
sonika-shah merged 5 commits into
Conversation
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
@aniruddhaadak80 Thanks for picking this up! One thing before it can go in: for |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
om_analyzer in the zh mapping uses the letter tokenizer, which keeps Chinese text as one token, so partial Chinese synonym queries would stop matching the boosted synonyms field. Use ik_max_word/ik_smart like the other zh text fields, and check each locale's synonyms analyzers against its displayName.
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Code Review ✅ Approved 1 closed / 1 findings🔴 High risk · Adding analyzer and subfield mappings to glossary-term indexes requires reindexing; stale mappings could make synonym searches behave inconsistently. Aligns English, Russian, and Chinese glossary synonym mappings with the Japanese n-gram subfield, adding ✅ 1 closed✅ Bug: zh synonyms now use letter-tokenizer om_analyzer, breaking CJK matching
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
…imit (#37385) synonyms.ngram, added by #34052, used om_ngram to analyze the query as well as the index, so every query word became one clause per 3-20-character n-gram. Together with name.ngram and displayName.ngram, that took the composite-alias search past the glossary term shard's 1024-clause limit. SearchCountConsistencyIT has failed in main's nightly embedded search lane on every run since 11-05. The en and ru mappings now analyze synonyms.ngram queries with om_compound_analyzer. A word inside a synonym still matches the stored n-grams, at one clause per word. zh keeps its 2-3-character n-grams on both sides; they stay few, and Chinese partial matching needs them. GlossarySynonymNgramIT covers both behaviors. On the previous mapping, its 80-letter query fails with maxClauseCount.
…37483) #34052 checked each locale's `synonyms` analyzers against its `displayName` and fixed en, ru and zh. ko was left on the default `standard` analyzer with no subfields, so two things are broken there: - `GlossaryTermIndex` boosts `synonyms.ngram` at 1.0 and `searchSettings.json` declares it as a search field, but the subfield does not exist in the ko mapping, so that leg of the query matches nothing. - `synonyms` itself is indexed with `standard`, so Korean synonyms are not segmented. A synonym written as "회원의 가입" is not found by searching "회원 가입", which is the gap #30831 closed everywhere except this field. This gives ko the same shape zh already has, substituting the Korean analyzer for IK the same way #30831 did: `nori` where zh uses `ik_max_word`/`ik_smart`, and `om_ngram` for the ngram subfield, which is already defined in this file. Requires a reindex of `glossary_term_search_index` to take effect. `IndexMappingVersionTracker` reports glossaryTerm as the only changed mapping. Co-authored-by: kyun6318 <[email protected]> Co-authored-by: Claude Opus 5 <[email protected]>



Describe your changes:
Fixes #33456
I aligned the English, Russian, and Chinese glossary-term synonym mappings with the existing Japanese n-gram subfield. Each locale now analyzes the base
synonymsfield, exposessynonyms.ngramwithom_ngram, and retains a keyword subfield; Chinese also gains the missingsynonyms.keywordmapping.The cross-language mapping regression test now locks the analyzer and both subfields so a future locale copy cannot silently remove the boosted search path.
Deployment note: reindex
glossary_term_search_indexafter deploying this change so existing glossary-term documents use the new mapping and analyzers.Type of change:
High-level design:
N/A - locale mapping correction with a focused regression test.
Tests:
Use cases covered
om_analyzeron the base field.synonyms.ngramwith theom_ngramanalyzer.synonyms.keyword; this restores exact matching support for Chinese.Unit tests
openmetadata-service/src/test/java/org/openmetadata/service/search/IndexMappingNestedFieldConsistencyTest.javamvn -B -pl openmetadata-service -am -Dtest=IndexMappingNestedFieldConsistencyTest -Dsurefire.failIfNoSpecifiedTests=false testmvn -B spotless:checkmvn -B -pl openmetadata-service -am -Pstatic-code-analysis -DfailIfNoTests=false -Dsonar.skip=true packageBackend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
Not performed in this remote-only contribution. After deployment, reindex
glossary_term_search_indexbefore manually verifying synonym queries in each affected locale.UI screen recording / screenshots:
Not applicable - no UI changes.
Checklist:
Fixes <issue-number>: <short explanation>.Fixes #<issue-number>above.