Repository navigation
Fixes #30830: Add Korean (KO) search index mapping language with the nori analyzer - #30831
Conversation
…age with the nori analyzer Korean is not a supported search index mapping language, so Korean text is indexed with om_analyzer (standard tokenizer + word_delimiter + kstem). Korean compounds are written without spaces, so a phrase like 주문상세내역 becomes a single opaque term and free-text search over description effectively does not work. This follows the zh pattern: reference the analysis plugin's built-in analyzer directly, with nori instead of ik_max_word. The ko/ mappings are derived from zh/ and route the same field set, so there is no ko-specific policy to maintain — nori has no max/smart split, so the ik_smart search_analyzer is dropped. analysis-nori is an official Elasticsearch/OpenSearch bundled plugin and installs with a single --batch flag, unlike analysis-ik which the integration-test image already pulls from a third-party release URL. As with jp and zh, the plugin is required only for deployments that select this language; EN remains plugin-free. SearchConsumerFieldBehaviorIT discovers languages from IndexMappingLanguage.values(), so adding the enum constant makes it exercise ko automatically. The test image now installs analysis-nori and the sample-text map covers ko, keeping the suite green.
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
|
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! |
|
Heads-up on the Aug 12 run — the failures here are all the
Re-applying Happy to handle anything on my side if that's easier. |
|
|
Thanks for the label. Checked the results and everything exercising this change is green: generate-types, Java/Python/UI checkstyles, Sonar, validate-json-yaml, and ES index creation during bootstrap all pass with the KO mapping. The failures look like infra issues. All Java/Python integration lanes fail on the Docker pull for minio/minio:RELEASE.2024-01-16T16-07-38Z with a 404 from Docker Hub, which main has been hitting since ~Aug 22. basedpyright errors are in files untouched by this PR (DB2/DBT/Vertica/Kafka), and the impact-map drift just means the branch is behind main. I can update the branch, but that drops the safe to test label. Feel free to update and re-label it yourself to do it in one pass. Also, #30830 still needs Source/Priority/Domain/Release in the Shipping project for the metadata check. |
|
@kyun6318 can you resolve the conflicts, please. Make sure all the tests are passing |
|
@kyun6318 also make sure one can set the config at the server config as well OpenMetadata/conf/openmetadata.yaml Line 608 in 7f016ef |
Resolve conflicts from the language-analysis refactors on main and re-derive the Korean index mappings from the current zh mappings. - ko mappings: regenerate all 62 files from upstream zh (ik_max_word / ik_smart -> nori), carrying the om_ngram settings the zh files omit for directory/drive_service/file/folder/spreadsheet/user/worksheet. Picks up asciifolding, om_plural_stemmer, flattened testCaseResolutionStatusDetails, description positions, dimension-by-name and the vector fields. - SearchTestImages: install analysis-nori alongside kuromoji via the new time-bounded official-plugin install command. - Add ko to the language lists in IndexMappingNestedFieldConsistencyTest and AvailableEntityTypesConsistencyTest. - SearchIndexMappingLanguageConfigTest: parse the shipped conf/openmetadata.yaml with ELASTICSEARCH_INDEX_MAPPING_LANG=KO and assert it resolves to a Korean mapping file for every indexed entity. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Eq7ov4iB7zJgL7DXYnFBLb
|
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! |
|
Merged main and re-derived the ko mappings from the current zh ones (same ik→nori swap, now with the asciifolding/plural-stemmer/flattened-resolution-status changes). Added |
…o probes - ko mappings: add asciifolding to om_ngram in the 7 files whose ngram settings ko defines but zh omits (directory, drive_service, file, folder, spreadsheet, user, worksheet), matching en and the accent-insensitivity invariant from open-metadata#22011. Regenerable: upstream zh with ik_max_word/ik_smart -> nori, plus en's ngram settings where zh lacks them. - IndexAnalyzerMappingTest: include ko in the four language loops. - IndexMappingVersionTracker: derive the language list from IndexMappingLanguage instead of a hardcoded array. - SearchConsumerFieldBehaviorIT: use "월간 매출이 증가했다" -> "매출" for ko so the probe only passes when nori strips the subject particle; the standard analyzer keeps 매출이 as one token. Note nori in the class Javadoc. - Regenerate src/jsons and public/jsons via parseSchemas.js so the committed dereferenced schemas carry KO (typescript-type-generation fails fork PRs on drift since open-metadata#32150). - SearchIndexMappingLanguageConfigTest: explicit UTF-8 when reading mappings. - SearchTestImages: rewrap Javadoc to 100 columns. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Eq7ov4iB7zJgL7DXYnFBLb
|
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! |
Re-derive the ko mappings from main's zh mappings with the same rule as before (ik_max_word/ik_smart become nori; en's ngram settings fill in where zh references om_ngram without defining it). This adds data_contract and metric_group and picks up main's field changes in 20 existing mappings. Add ko to the language lists main added in ContextMemoryIndexMappingTest and DataContractIndexMappingTest. SearchTestImages keeps main's vendored analysis-ik and installs analysis-nori by name next to analysis-kuromoji.
|
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! |
🚦 Removed from the merge queue —
|
|
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🟡 Medium risk · Adding Korean nori mappings and a selectable KO language changes indexing and search behavior; deployments without analysis-nori could fail index creation. Adds 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 |
|
|
79ae963
…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 #30830
Korean is not one of the supported
searchIndexMappingLanguagevalues, so Korean text is indexed withom_analyzer— astandardtokenizer plusword_delimiterandkstem. Korean writes compounds without spaces, so a phrase like주문상세내역("order detail history") becomes one opaque term and free-text search overdescriptioneffectively does not work.This adds
KOalongsideJP,ZHandRU, following the zh pattern: reference the analysis plugin's built-in analyzer directly rather than hand-assembling one.ko/is derived fromzh/and routes the same field set, so there is no Korean-specific policy to maintain — the only differences areik_max_word→nori, and dropping theik_smartsearch_analyzersince nori has no max/smart split.Field routing is identical to
zh/— the same 178 dotted paths carry the language analyzer, and everything else (om_analyzer,om_ngram,om_compound_analyzer, ngram settings) is unchanged. Wherezhapplies its analyzer to a field thatenleaves unanalyzed (66 such paths),kodoes the same; there is no path wherekoandzhdiverge.Why the built-in analyzer rather than hand-assembling one
jpbuildsom_analyzer_jpfromkuromoji_tokenizerplus four filters, so it is fair to ask whykodoes not do the same — Korean is agglutinative like Japanese, not isolating like Chinese.The reason is that the two languages need different things from their plugins.
analysis-noriships a built-innorianalyzer that already chainsnori_tokenizer+nori_part_of_speech+nori_readingform+lowercase, which is exactly what Korean needs — particles and verb endings dropped, Hanja folded to Hangul:Hand-assembling the same chain reproduces this token for token, so it would add a settings block to 43 files without changing behaviour.
jpassembles its own because it wants a slightly different set than the built-in kuromoji analyzer (kuromoji_numberadded,ja_stopomitted);kohas no such deviation to make.Why
decompound_modeis left at its defaultnori_tokenizertakes adecompound_mode, andmixedlooked promising — it keeps the original compound alongside its parts, which improves ranking when the query is exactly that compound. I measured it and it does help there:But it breaks
match_phrase. Lucene does not persistpositionLengthat index time, so the compound token is stored with width 1, while query-time analysis emits it as a width-2 graph token wrapped in aspanOr. The span never lines up:That matters here because
matchType: phraseis not limited tosearchFields. It also appears inranking.stages[phraseName](weight 70.0, applied to every asset type since noassetTypeConfigurationsentry overridesranking), which coversfullyQualifiedName, and inbuildHierarchyQuery, which hard-codesmatchPhraseonname,displayName,fullyQualifiedNameand theglossary.*variants independently ofsearchSettings.json. Quotedquery_stringinput reachesdescriptionthroughbuildComplexQueryV2as well.Restricting
mixedto fields that take no phrase query does not save it either, because the ranking gain does not survive measurement: across 92matchqueriesmixedimproved recall on zero of them and lost recall on 6 (6.5%).discardalready emits the constituent parts, so the only thingmixedadds is the compound original — which helps ranking in narrow cases and costs phrase matching everywhere.Mirroring zh's asymmetric pair (
index=mixed/search=discard) is not an option for nori either:ik_smartstill emits multi-character words, but nori'sdiscardnever emits the compound original, so the indexed token would never be queried. Phrase stays safe and the gain is exactly zero.Plugin requirement
analysis-norimust be installed on the cluster, exactly asanalysis-kuromojiis forJPandanalysis-ikis forZH. Behaviour on a stock OpenSearch 3.4.0 node with no analysis plugins, creatingtable_index_mapping:ENJPom_analyzer_jp failed to find tokenizer [kuromoji_tokenizer]ZHanalyzer [ik_smart] has not been configuredKOanalyzer [nori] has not been configuredSo this adds no new class of requirement. Only deployments that explicitly set
ELASTICSEARCH_INDEX_MAPPING_LANG=KOare affected,ENstays plugin-free, and the failure is a loud 400 at index creation rather than silent degradation.analysis-noriis an official Elasticsearch/OpenSearch bundled plugin —opensearch-plugin install --batch analysis-noriresolves from the official repository, unlikeanalysis-ikwhich the integration-test image already pulls from a third-party release URL.Known limitation
nori's dictionary does not cover every compound, and an unknown one is mis-segmented rather than left whole:
Searching for
상세will not find that document. This is inherent to nori without auser_dictionary, and it is still a clear improvement over the status quo, where the whole string is one term and no substring search works at all:주문상세내역 관리 테이블ENtodayKO주문상세내역주문내역내역상세Testing
SearchConsumerFieldBehaviorITderives its language list fromIndexMappingLanguage.values(), so adding the enum constant makes it exercisekoautomatically. Two lines keep it green: the test image installsanalysis-nori, andLANGUAGE_SAMPLE_TEXTgains akoentry. 17/17 pass, including the analyzer segmentation check (월간 매출 보고서→매출).Also verified locally against OpenSearch 3.4.0 with
analysis-nori:ko/mappings create successfully through the sameOsUtils.enrichIndexMappingForOpenSearchpath the service uses.ko/mapping is either defined in the file or provided by the plugin — no dangling references.zh/exactly, path for path.match_phraseonname,displayNameandfullyQualifiedNamereturns the document for its own full name.fact_order→[fact, order].Unit suites touching the language list pass:
IndexMappingNestedFieldConsistencyTest(6),DataProductIndexMappingTest(2),IndexMappingVersionTrackerTest(24).Note on reindexing
IndexMappingVersionTrackerhashes the bundled mappings across all languages to decide which indexes need recreating, so addingkoto that array changes the hash for every entity type. A minor upgrade already forces a full reindex, so this should ride a minor release rather than a patch backport.Files
elasticSearchConfiguration.json—KOadded to the enumopenmetadata-spec/src/main/resources/elasticsearch/ko/— 62 new mappingsIndexMappingVersionTrackerand three test classes —koadded to the language arraysSearchTestImages/SearchConsumerFieldBehaviorIT— installanalysis-nori, coverkoApplicationSchemas/SearchIndexingApplication.json— regenerated enumType of change:
Checklist:
Fixes <issue-number>: <short explanation>searchIndexingAppConfig.jsonpicks it up through its existing$ref.

Confidence Score: 5/5
The PR appears safe to merge for the stated minor release.Summary
Adds
KOas a search mapping language and supplies Korean mappings that usenorion the fields selected by the existingzhmappings.norianalyzer.Reviews (5) · Last reviewed commit: "Merge branch 'main' into feat/ko-nori-ma..." · Reviewed by Greptile