janhoy commented on code in PR #2886:
URL: https://github.com/apache/solr/pull/2886#discussion_r1860286943
##########
solr/modules/langid/src/test/org/apache/solr/update/processor/LanguageIdentifierUpdateProcessorFactoryTestCase.java:
##########
@@ -464,6 +466,101 @@ public void testMapIndividual() throws Exception {
assertTrue(mappedIndividual.containsKey("text2_ru"));
}
+ @Test
+ public void testAllowlistWithFallback() throws Exception {
+ ModifiableSolrParams parameters = new ModifiableSolrParams();
+ parameters.add("langid.fl", "name,subject");
+ parameters.add("langid.langField", "language_s");
+ parameters.add("langid.allowlist", "no,en ,,,sv"); // Any other language
will fallback to EN
+ parameters.add("langid.fallback", "en");
+ liProcessor = createLangIdProcessor(parameters);
+
+ // Make sure that empty language codes have been filtered out and others
trimmed.
Review Comment:
Should be no need to do an actual detection here (which currently fails
tests). Suffice to check that the `langAllowList` got populated, and delete all
the `assertLang`s.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]