Describe the bug
When configuring a facet with aggLang variable
"OrgForResource": {
"terms": {
"field": "OrgForResourceObject.${aggLang}",
"include": ".*",
"size": 20
},
"meta": {
"caseInsensitiveInclude": true
}
},
This code calculates the value to replace in aggLanguage
|
this.getLanguageConfig = function (any, state) { |
|
var languageFound = false, |
|
searchLanguage = "lang" + state.forcedLanguage, |
|
uiLanguage = "lang" + gnGlobalSettings.iso3lang, |
|
aggLanguage = "lang" + gnGlobalSettings.iso3lang; |
|
state.detectedLanguage = undefined; |
|
if (state.forcedLanguage !== undefined) { |
|
searchLanguage = aggLanguage = "lang" + state.forcedLanguage; |
|
languageFound = true; |
|
} else if (state.languageStrategy === "searchInDetectedLanguage") { |
|
searchLanguage = this.autoDetectLanguage(any || "", state.languageWhiteList); |
|
state.detectedLanguage = searchLanguage; |
|
languageFound = searchLanguage !== "und"; |
|
if (languageFound) { |
|
searchLanguage = aggLanguage = "lang" + searchLanguage; |
|
} else { |
|
searchLanguage = "\\*"; |
|
} |
|
} else if (state.languageStrategy === "searchInUILanguage") { |
|
searchLanguage = aggLanguage = uiLanguage; |
|
languageFound = true; |
|
} else if ( |
|
state.languageStrategy && |
|
state.languageStrategy.indexOf("searchInThatLanguage") === 0 |
|
) { |
|
var config = state.languageStrategy.split(":"); |
|
if (config.length !== 2) { |
|
console.warn( |
|
"When using language strategy searchInThatLanguage, configuration MUST be like searchInThatLanguage:fre" |
|
); |
|
} else { |
|
searchLanguage = aggLanguage = "lang" + config[1]; |
|
languageFound = true; |
|
} |
|
} else if (state.languageStrategy === "searchInAllLanguages") { |
|
languageFound = false; |
|
searchLanguage = "\\*"; |
|
uiLanguage = "\\*"; |
|
aggLanguage = "default"; |
|
} |
|
return { |
|
languageFound: languageFound, |
|
searchLanguage: searchLanguage, |
|
uiLanguage: uiLanguage, |
|
aggLanguage: aggLanguage |
|
}; |
|
}; |
Sometimes the parameter state only contains a property filter and others contains additional properties like languageStrategy that causes different output.
To Reproduce
Steps to reproduce the behavior:
- Go to https://apps.titellus.net/geonetwork/srv/dut/catalog.search#/home (Dutch UI) and select from the menu the search option
Zoeken --> The Organisation facet is displayed
The search request request the aggregation field OrgForResourceObject.default
- In other tab open the search page in Dutch --> https://apps.titellus.net/geonetwork/srv/dut/catalog.search#/search --> The organisation facet is not displayed
The search request request the aggregation field OrgForResourceObject.langdut
Expected behavior
Results are the same.
This code probably should be initialised with the settings values for languageStrategy and other fields:
|
$scope.searchObj.state = { |
|
filters: {} |
|
}; |
It's unclear in case 1. how is filled, as the code that seems to fill that object it's not executed:
|
$scope.searchObj.state = { |
|
filters: {}, |
|
exactMatch: false, |
|
titleOnly: false, |
|
languageStrategy: "searchInAllLanguages", |
|
forcedLanguage: undefined, |
|
languageWhiteList: undefined, |
|
detectedLanguage: undefined |
|
}; |
@fxprunayre any idea about this?
Describe the bug
When configuring a facet with
aggLangvariableThis code calculates the value to replace in
aggLanguagecore-geonetwork/web-ui/src/main/resources/catalog/components/elasticsearch/EsService.js
Lines 47 to 93 in 16df866
Sometimes the parameter
stateonly contains a propertyfilterand others contains additional properties likelanguageStrategythat causes different output.To Reproduce
Steps to reproduce the behavior:
Zoeken--> The Organisation facet is displayedThe search request request the aggregation field
OrgForResourceObject.defaultThe search request request the aggregation field
OrgForResourceObject.langdutExpected behavior
Results are the same.
This code probably should be initialised with the settings values for
languageStrategyand other fields:core-geonetwork/web-ui/src/main/resources/catalog/components/search/searchmanager/SearchFormDirective.js
Lines 64 to 66 in 16df866
It's unclear in case 1. how is filled, as the code that seems to fill that object it's not executed:
core-geonetwork/web-ui/src/main/resources/catalog/components/search/searchmanager/SearchFormDirective.js
Lines 372 to 380 in 16df866
@fxprunayre any idea about this?