snowstorm
snowstorm copied to clipboard
MRCM Range search - wrong language
Hi! me again... I trying the MRCM endpoints. When i want to search for attributes values in Spanish, Snowstorm insist to search in English. Example:
curl -X 'GET' \
'http://localhost:8080/mrcm/MAIN%2FSNOMEDCT-ES%2FSNOMEDCT-AR/attribute-values/263502005?contentType=NEW_PRECOORDINATED&termPrefix=crónico' \
-H 'accept: application/json' \
-H 'Accept-Language: es'
But if i change crónico by chronic, i get values.
Searching for query logs in Elasticsearch, i found that Snowstorm is setting the languageCode to en:
{
"from": 0,
"size": 10000,
"query": {
"bool": {
"must": [
... BRANCH CRITERIA
{
"terms": {
"languageCode": [
"en"
],
"boost": 1.0
}
},
{
"term": {
"active": {
"value": true
}
}
}
],
"filter": [
{
"bool": {
"must": [
{
"bool": {
"should": [
{
"bool": {
"filter": [
{
"query_string": {
"query": "chronic*",
"fields": [
"termFolded^1.0"
],
"default_operator": "and",
"boost": 2.0
}
}
],
"boost": 1.0
}
},
{
"bool": {
"filter": [
{
"query_string": {
"query": "chronic*",
"fields": [
"termFolded^1.0"
],
"default_operator": "and",
"boost": 2.0
}
}
],
"boost": 1.0
}
},
{
"bool": {
"filter": [
{
"query_string": {
"query": "chronic*",
"fields": [
"termFolded^1.0"
],
"default_operator": "and",
"boost": 2.0
}
}
],
"boost": 1.0
}
},
{
"bool": {
"filter": [
{
"query_string": {
"query": "chronic*",
"fields": [
"termFolded^1.0"
],
"default_operator": "and",
"boost": 2.0
}
}
],
"boost": 1.0
}
},
{
"bool": {
"filter": [
{
"query_string": {
"query": "chronic*",
"fields": [
"termFolded^1.0"
],
"default_operator": "and",
"boost": 2.0
}
}
],
"boost": 1.0
}
},
{
"bool": {
"filter": [
{
"query_string": {
"query": "chronic*",
"fields": [
"termFolded^1.0"
],
"default_operator": "and",
"boost": 2.0
}
}
],
"boost": 1.0
}
},
{
"bool": {
"filter": [
{
"query_string": {
"query": "chronic*",
"fields": [
"termFolded^1.0"
],
"default_operator": "and",
"boost": 2.0
}
}
],
"boost": 1.0
}
}
],
"boost": 1.0
}
}
],
"boost": 1.0
}
}
],
"boost": 1.0
}
},
"version": true,
"_source": {
"includes": [
"descriptionId",
"conceptId"
],
"excludes": []
},
"sort": [
{
"termLen": {
"order": "asc",
"mode": "min"
}
},
{
"_score": {
"order": "asc"
}
}
]
}
It appears that the Accept-Language header is only utilized for the response, rather than the query.