Skip to content

[25.0.x] - geonetwork search records request error #154

@Gaetanbrl

Description

@Gaetanbrl

With fresh install (master / 25.0.x), i get a 400 error on POST request :
https://georchestra.example.org/geonetwork/srv/api/search/records/_search :

Here, the POST payload :

{
    "from": 0,
    "size": 12,
    "sort": [{
        "createDate": "desc"
    }, "_score"],
    "query": {
        "function_score": {
            "boost": "5",
            "functions": [{
                "filter": {
                    "match": {
                        "resourceType": "series"
                    }
                },
                "weight": 1.5
            }, {
                "filter": {
                    "exists": {
                        "field": "parentUuid"
                    }
                },
                "weight": 0.3
            }, {
                "filter": {
                    "match": {
                        "cl_status.key": "obsolete"
                    }
                },
                "weight": 0.2
            }, {
                "filter": {
                    "match": {
                        "cl_status.key": "superseded"
                    }
                },
                "weight": 0.3
            }, {
                "gauss": {
                    "changeDate": {
                        "decay": 0.5,
                        "offset": "90d",
                        "scale": "365d"
                    }
                }
            }],
            "score_mode": "multiply",
            "query": {
                "bool": {
                    "must": [{
                        "terms": {
                            "isTemplate": ["n"]
                        }
                    }]
                }
            }
        }
    },
    "aggregations": {},
    "_source": {
        "includes": ["id", "uuid", "creat*", "cl_topic*", "inspire*", "resource*", "image*", "tag*"]
    },
    "script_fields": {
        "overview": {
            "script": {
                "source": "return params['_source'].overview == null ? [] : params['_source'].overview.stream().findFirst().orElse([]);"
            }
        }
    }
}

Error :

Type Status Report

Message Error is: Bad Request. Request: {"from":0,"size":12,"sort":[{"createDate":"desc"},"_score"],"query":{"function_score":{"boost":"5","functions":[{"filter":{"match":{"resourceType":"series"}},"weight":1.5},{"filter":{"exists":{"field":"parentUuid"}},"weight":0.3},{"filter":{"match":{"cl_status.key":"obsolete"}},"weight":0.2},{"filter":{"match":{"cl_status.key":"superseded"}},"weight":0.3},{"gauss":{"changeDate":{"decay":0.5,"offset":"90d","scale":"365d"}}}],"score_mode":"multiply","query":{"bool":{"must":[{"terms":{"isTemplate":["n"]}}],"filter":{"query_string":{"query":"*:* AND (draft:n OR draft:e)"}}}}}},"aggregations":{},"_source":{"includes":["id","uuid","creat*","cl_topic*","inspire*","resource*","image*","tag*","op*","documentStandard","groupOwner","owner","id"]},"script_fields":{"overview":{"script":{"source":"return params['_source'].overview == null ? [] : params['_source'].overview.stream().findFirst().orElse([]);"}}}} . Error: {"error":{"root_cause":[{"type":"query_shard_exception","reason":"No mapping found for [createDate] in order to sort on","index_uuid":"5SJVuM4VTl6Ak7flBqIj9w","index":"gn-records"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"gn-records","node":"7J5iByNgRRa64EWRjVEmRw","reason":{"type":"query_shard_exception","reason":"No mapping found for [createDate] in order to sort on","index_uuid":"5SJVuM4VTl6Ak7flBqIj9w","index":"gn-records"}}]},"status":400}.

Description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).

"No mapping found for [createDate] in order to sort on","index_uuid"

This is maybe linked with https://groups.google.com/g/georchestra-dev/c/JqtXO-hkn_U and #152.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions