{
    "error": {
        "root_cause": [
            {
                "type": "query_shard_exception",
                "reason": "No mapping found for [id] in order to sort on",
                "index_uuid": "KrxKsV5bSam3zz6oz-_6-w",
                "index": "content"
            }
        ],
        "type": "search_phase_execution_exception",
        "reason": "all shards failed",
        "phase": "query",
        "grouped": true,
        "failed_shards": [
            {
                "shard": 0,
                "index": "content",
                "node": "0aVzWwFeRSyM26qXRZXofA",
                "reason": {
                    "type": "query_shard_exception",
                    "reason": "No mapping found for [id] in order to sort on",
                    "index_uuid": "KrxKsV5bSam3zz6oz-_6-w",
                    "index": "content"
                }
            }
        ]
    },
    "status": 400
}

错误:                "reason": "No mapping found for [id] in order to sort on",、

大概意思 :查询时候遇到id 这个作为排序字段,但是es 不存在的

解决方案:后端不设置排序字段 或者 通过head 查询一下数据 看一下 要正确排序字段

 

 

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐