Add flag Pattern.UNICODE_CHARACTER_CLASS to pattern compilation to recognize unicode characters

This commit is contained in:
Toni Prieto
2023-07-10 13:43:27 +02:00
parent ea4565bd60
commit 4aea2a99a9

View File

@@ -845,7 +845,7 @@ public class ItemIndexFactoryImpl extends DSpaceObjectIndexFactoryImpl<Indexable
private void saveFacetPrefixParts(SolrInputDocument doc, DiscoverySearchFilter searchFilter, String value,
String separator, String authority, String preferedLabel) {
value = StringUtils.normalizeSpace(value);
Pattern pattern = Pattern.compile("\\b\\w+\\b", Pattern.CASE_INSENSITIVE);
Pattern pattern = Pattern.compile("\\b\\w+\\b", Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CHARACTER_CLASS);
Matcher matcher = pattern.matcher(value);
while (matcher.find()) {
int index = matcher.start();