routing_missing_exception: Routing value is required for this document(此文档需要 routing 值)
Elasticsearch含义
访问/索引该文档需要 routing 值,但未提供。没有 routing,Elasticsearch 无法确定文档属于哪个分片。
原因
索引映射定义了 _routing required=true;使用了 parent-join(父/子)关系,子文档需要 routing;或 index/get/update/delete 请求中遗漏了 routing 参数。读取用自定义 routing 写入的文档时未提供 routing 是典型原因。
解决方法
在请求中显式指定 routing 值(例如在 index/get/update/delete 调用中使用 ?routing=value)。使用 parent-join 时,为子文档传入父文档的 id 作为 routing。读取/更新/删除时使用与写入文档时相同的 routing。检查映射中的 _routing 要求(required)。
同一数据库的其他条目
- document_source_missing_exceptionDocument source is missing(文档 source 不存在)
- node_not_connected_exceptionNode is not connected(节点未连接)
- receive_timeout_transport_exceptionRequest timed out waiting for a response from another node(等待另一节点响应时请求超时)
- too_many_buckets_exceptionTrying to create too many buckets(试图创建过多的桶)
- shard_lock_obtain_failed_exceptionObtaining shard lock timed out(获取分片锁超时)
- parsing_exceptionFailed to parse the search request / query DSL(无法解析搜索请求/query DSL)
- max_bytes_length_exceeded_exceptionDocument contains at least one immense term that is too long(文档中至少包含一个过长的超大词项)