Hi,
trying to deploy datahub v1.0.1 w/ GN 4.0.6 within georchestra, so far it works fine *but* on the homepage, the request trying to get the amount or orgs fails with a 400 code.
the reply seems to come from ES, which is 7.17.9 (upstream ES debian package), and is undecipherable mumbo-jumbo only ES experts can probably understand:
Error is: Bad Request. Request: {"aggregations":{"contact":{"nested":{"path":"contactForResource"},"aggs":{"org":{"terms":{"field":"contactForResource.organisation","exclude":"","size":1000,"order":{"_key":"asc"}},"aggs":{"mail":{"terms":{"size":1000,"exclude":"","field":"contactForResource.email.keyword"}}}}}}},"from":0,"size":0,"query":{"bool":{"must":[{"terms":{"isTemplate":["n"]}}],"must_not":{"terms":{"resourceType":["service","map","map/static","mapDigital"]}},"should":,"filter":[{"query_string":{"query":"(op0:(0 OR 1) ) AND (draft:n OR draft:e)"}}]}},"_source":} . Error: {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [contactForResource.organisation] in order to load field data by uninverting the inverted index. Note that this can use significant memory."}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"gn-records","node":"Xm14XIsPRQiXF8-EfHgK5w","reason":{"type":"illegal_argument_exception","reason":"Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [contactForResource.organisation] in order to load field data by uninverting the inverted index. Note that this can use significant memory."}}],"caused_by":{"type":"illegal_argument_exception","reason":"Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [contactForResource.organisation] in order to load field data by uninverting the inverted index. Note that this can use significant memory.","caused_by":{"type":"illegal_argument_exception","reason":"Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [contactForResource.organisation] in order to load field data by uninverting the inverted index. Note that this can use significant memory."}}},"status":400}.
My understanding is that something is wrong in the ES index configuration, but i have no idea where this can be modified/tweaked. The GN config wrt ES should be 'stock' afaict, i've looked at https://geonetwork-opensource.org/manuals/4.0.x/en/maintainer-guide/statistics/setup-elasticsearch.html & https://geonetwork-opensource.org/manuals/4.0.x/en/install-guide/installing-index.html but that doesnt help much.
this is reproducible on 2 internal instances and https://demo.georchestra.org/datahub/ (open network console, look for the 400 error code on POST https://demo.georchestra.org/geonetwork/srv/api/search/records/_search?bucket=bucket.
I see it works fine on https://geo2france.fr/datahub/ but i dunno what is different there..
Thanks for any pointers/help.
--
Landry Breuil