Skip to content

SOLR-11033: introduce multilingual configset - #5370

Open
epugh wants to merge 11 commits into
apache:mainfrom
epugh:SOLR-11033-multilingual-clean
Open

epugh wants to merge 11 commits into
apache:mainfrom
epugh:SOLR-11033-multilingual-clean

Conversation

@epugh

@epugh epugh commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

https://issues.apache.org/jira/browse/SOLR-11033

Description

Move built-in language-specific text analysis out of _default into a new _multilingual configset. New collections using _default get general-purpose field types; collections needing types such as text_en or dynamic fields such as *_txt_fr can select _multilingual. Existing ZooKeeper configsets and collections remain unchanged.

Even better, you can use teh Schema Designer to pick your languages (driven by the new _multilingual configset and add those fields to your own configset! imagine if we offered lots of sample configsets that you cherry picked to make your configset?

also some improvements in schema designer, the big one being the list of languages is now not hardcoded.

Related: #971.

Solution

  • Move language-specific field types, dynamic fields, and supporting files into _multilingual, using the current schemas and dictionaries.
  • Keep _multilingual's generic analyzers free of stopword removal and synonym expansion. Stopwords and synonyms use language-specific files under lang/; _default keeps its existing generic resources.
  • Bootstrap _multilingual when installed locally and absent from ZooKeeper, preserving existing configsets. Follow _default's startup upload path without expanding CoreContainer's filesystem allowlist.
  • Let Schema Designer restore selected languages from _multilingual while preserving custom source definitions and files. Generic schema editing also works when _multilingual is absent.
  • Populate Schema Designer's language selector from the _multilingual schema in ZooKeeper, using Java locale names. Use cs for Czech field types, dynamic fields, and resources in the new configset.
  • Ship only _default in the slim distribution; include _multilingual and the techproducts configset in the full distribution.
  • Update Schema Designer help, the reference guide, Solr 11 upgrade notes, and the changelog.

Developed with assistance from OpenAI Codex.

Tests

  • ./gradlew tidy and ./gradlew check -x test passed.
  • Existing focused Java suites covering configset services, Schema Designer, configset APIs, ZooKeeper reads, and CoreContainer passed, with 3 skipped. Regression coverage verifies startup outside the API path allowlist and preservation of that allowlist.
  • Schema Designer Java suites: 29 tests passed. Headless browser suite: all 3 tests passed, covering schema-driven language choices, saving a language selection, and an absent _multilingual configset.
  • Packaged CATS CreateCollectionTest and ZkTest: all 24 tests passed, including creating a _multilingual collection and indexing and querying French text.
  • Built and inspected both distribution archives: slim contains only _default; full contains _default, _multilingual, and sample_techproducts_configs.

}

private void bootstrapMultilingualConf(CoreContainer coreContainer) throws IOException {
if (checkConfigExists(ConfigSetsHandler.MULTILINGUAL_CONFIGSET_NAME)) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the slim distribution doesn't ship wiht multilingual...

@github-actions

Copy link
Copy Markdown

Automated PR readiness judgements (LLM-generated; may be wrong; not updated on later pushes).

  • ✅ Jira issue in title: already present
  • ⚠️ Changelog — differs from the entry (suggest type: added; PR has type: changed): The PR introduces a new `_multilingual` configset and modifies the `_default` configset to remove language-specific types, which is a new feature/​configuration option for users to opt into, warranting an 'added' changelog entry.​
  • ✅ Reference Guide update: included
  • ✅ Upgrade notes: included
  • ✅ Tests: included

@epugh

epugh commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

I am backing out the allowPath hardening for _multilingual because it doesn't apply to _default. I think a seprate PR should deal with boht at once... Worried about scope creep.

@epugh

epugh commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

I still want to remove all the language specific stuff from sample_techproducts_configs and indeed just rename it techproducts and maybe jsut ship it as a default.....


List<Language> listAvailableLanguages() throws IOException {
if (!cc.getConfigSetService().checkConfigExists(MULTILINGUAL_CONFIGSET_NAME)) {
return List.of();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI text below 🤖

On a slim installation without _multilingual, this disables the language selector even if an existing configset contains language types. For example, an upgraded cluster can retain the old _default configset in ZooKeeper. Could Designer still offer the languages from the schema being edited in that case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, i think that's just a very narrow likelyhood. Folks using slim probably don't use the schema designer anyway...

if (!cc.getConfigSetService().checkConfigExists(MULTILINGUAL_CONFIGSET_NAME)) {
return List.of();
}
return loadLatestSchema(MULTILINGUAL_CONFIGSET_NAME).getFieldTypes().values().stream()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI text below 🤖

Existing Designer schemas can use cz for Czech, while _multilingual supplies cs. When a user changes the language selection, the old cz value has no matching option. The sync can then remove text_cz and *_txt_cz if no explicit field uses the type. Could the selector preserve the legacy choice for existing schemas?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm honestly not too worried about backwards compatiblity, just cause I think this is very small set of folks... I think we should mention this in the upgrade notes?


private void bootstrapMultilingualConf() throws IOException {
if (checkConfigExists(ConfigSetsHandler.MULTILINGUAL_CONFIGSET_NAME)) {
return;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI text below 🤖

The upload creates the configset znode before it writes all of the files. If the upload stops partway through, later starts see the znode and skip the upload, leaving an incomplete _multilingual configset. Another node can also see it before the upload finishes. Could bootstrap distinguish a complete upload from one still in progress or interrupted? I see that _default follows a similar path, so this may need a shared fix.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed that this maybe is a place for a better handling...

@epugh

epugh commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

I made a video ;-). https://share.descript.com/view/Rag9yZyjaHq

this.uploadConfig(confName, configPath);
}

private void bootstrapMultilingualConf() throws IOException {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a serious smell here that this issue should touch ConfigSetService! I'm definitely against this, sorry.

If we want to potentially upload multiple configSets to ZK, there should be a comma delimimted list somewhere and ConfigSetService should then have no hard-coded notion of multilingual; it just loops and uploads the named configsets, whatever they may be. Just an idea. OR (better, no new code), if this is just one confgset in addition to _default, then there are sys props in ConfigSetService / functionality that can be set to upload a named configset in addition.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually. did think of that earlier, but then was like "let me reduce the churn and just follow the pattenr of _default, but I can make that change. We can make the set of named configsets a setting that is passed in here...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I poked aorund and it seems like the right place to define configsets isn't in the ConfigSetService itself, but to pass them in, so I moved it up to NodeConfig. I didn't wire it into solr.xml, just left it as a system variable with defaults.

ConfigSetAdminResponse.List response = list.process(solrClient);
Collection<String> actualConfigSets = response.getConfigSets();
assertEquals(1, actualConfigSets.size()); // only the _default configset
assertEquals(Set.of("_default", "_multilingual"), Set.copyOf(actualConfigSets));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1 don't want multilingual by default

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you against the concept of multilingual? We already ship multilingual configurations in the _default configset, so this is cleaner (since _default doesn't actually use it)... Plus without this our schema designer, who also assumes multilingual is in _default previosuly, wouldn't work... The -slim distribution doesn't include it.. (Which I guess reminds me I better check that the Schema Designer handles that gracefully)....

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm -0 to uploading more than one configset to ZK by default. I wish we had a "dev mode" where we can vary our defaults, such as this. The schema designer is for dev use-case, not prod.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest raising this matter to the dev list; it deserves broad review.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did start a thread... I will follow up. I know lots of folks who manipulate and change schemes in a single environment...

Having said that, I've been looking forward to having distinct defaults that reflect a community consensus of dev, stage, prod for a long itme, but that would be for a seperate body of work!

…hat in NodeConfig

Not positivie that the extra change to MiniSolrCloudCluster is worth it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants