_search-language
Last updated
Was this helpful?
Last updated
Was this helpful?
_search-language
is experimental, generated SQL and semantic may change in future!
Search parameter _search-language
can be used to search specifying language.
Any (e.g. name) will search in desired language if there is _search-language
in query. Specifying only _search-language
without any other string search parameters won't affect anything (except _sort
).
You may use locales that are in FHIR.
By default _search-language is skipped. It can be turned on by
Aidbox searches for and if the resource contains it and the language is correct, then searches by the content of this translation.
Structure of a resource containing translation extension:
If desired language is not present in Translation Extension, it will search by search-parameter like without _search-language. This fallback can be turned off by
environment variable (true by default).
Note on field overwriting: Aidbox returns resource in FHIR format without any replacements.
Use Accept-Language
header instead of _search-language
:
Note that browsers send requests with Accept-Language
(e.g en-US,en;q=0.5) by default.
To enable Accept-Language support use
environment variable.
Collation is supported in Aidboxdb version 14.7+.
Get all locations, those names start with 'Clinique' in French:
Same with Accept-Language
header:
Get all locations and sort by their names in French, using French locale for sort order (COLLATE):
If some resource contains an array of strings, e.g. Location.alias, extensions can also be an array.
_search-language
can search through arrays (search parameter Location.name searches in name
, alias
, _name
and _alias
)
will use desired language if Accept-Language
or _search-language
are present.
By default PostgreSQL uses system locale . When searching by language, SQL will contain GROUP BY <...> COLLATE "<locale>"
. Note that if you want to use the non-default locale you must pass it to Aidboxdb with the EXTRA_LOCALES
. Also, note that if locale does not contain a territory part (language[_territory]
), Aidbox will use "language_LANGUAGE", e.g. "en_EN" (is not an locale) or "ru_RU" (correct locale).