Describe the bug
When the UI language is switched to Swedish (swe), an error message is immediately displayed on the search page: "Frågan returnerade ett fel. Undersök loggar för mer information." Investigation revealed that swe is registered as a supported UI language in CatController.js but is entirely absent from the Elasticsearch index mapping template records.json. All other supported languages (eng, fre, ger, dut, dan, ita, spa) have explicit field definitions in that file. Swedish does not, causing Elasticsearch to fall back to dynamic mapping for langswe fields, which results in a 400 error when facet aggregations are attempted on those fields.
To Reproduce
- Enable Swedish (
swe) as a UI language
- Open the catalogue search page in any working language
- Switch the UI language to Swedish using the language switcher
- Observe the error message on the search page
Expected behavior
The search page should load normally in Swedish, with facet aggregations working correctly, as they do for all other supported languages.
Screenshots
(pink error box screenshot attached)
Log file
Elasticsearch returns HTTP 400 with:
illegal_argument_exception: Text fields are not optimised for operations
that require per-document field data like aggregations and sorting.
Please use a keyword field instead. Alternatively, set fielddata=true
on [tag.langswe].
Desktop:
- Browser: Firefox
- GeoNetwork Version: 4.4.x
- Server Application: Tomcat 9 with Java 17, Elasticsearch 8.x
Additional context
The fix is to add langswe to all relevant sections of records.json, mirroring the pattern used for other languages, and rebuild the index. Other languages supported in CatController.js but absent from records.json may be affected by the same issue.

Describe the bug
When the UI language is switched to Swedish (
swe), an error message is immediately displayed on the search page: "Frågan returnerade ett fel. Undersök loggar för mer information." Investigation revealed thatsweis registered as a supported UI language inCatController.jsbut is entirely absent from the Elasticsearch index mapping templaterecords.json. All other supported languages (eng,fre,ger,dut,dan,ita,spa) have explicit field definitions in that file. Swedish does not, causing Elasticsearch to fall back to dynamic mapping forlangswefields, which results in a 400 error when facet aggregations are attempted on those fields.To Reproduce
swe) as a UI languageExpected behavior
The search page should load normally in Swedish, with facet aggregations working correctly, as they do for all other supported languages.
Screenshots
(pink error box screenshot attached)
Log file
Elasticsearch returns HTTP 400 with:
Desktop:
Additional context
The fix is to add
langsweto all relevant sections ofrecords.json, mirroring the pattern used for other languages, and rebuild the index. Other languages supported inCatController.jsbut absent fromrecords.jsonmay be affected by the same issue.