core-geonetwork icon indicating copy to clipboard operation
core-geonetwork copied to clipboard

Facets - aggLang variable it's not always replaced properly producing different results in the search filters

Open josegar74 opened this issue 1 year ago • 0 comments

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

https://github.com/geonetwork/core-geonetwork/blob/16df8661ea18dfbe36e976bc5f7bdbe4ac829e44/web-ui/src/main/resources/catalog/components/elasticsearch/EsService.js#L47-L93

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:

  1. 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

  1. 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:

https://github.com/geonetwork/core-geonetwork/blob/16df8661ea18dfbe36e976bc5f7bdbe4ac829e44/web-ui/src/main/resources/catalog/components/search/searchmanager/SearchFormDirective.js#L64-L66

It's unclear in case 1. how is filled, as the code that seems to fill that object it's not executed:

https://github.com/geonetwork/core-geonetwork/blob/16df8661ea18dfbe36e976bc5f7bdbe4ac829e44/web-ui/src/main/resources/catalog/components/search/searchmanager/SearchFormDirective.js#L372-L380

@fxprunayre any idea about this?

josegar74 avatar Jul 28 '23 10:07 josegar74