document_source_missing_exception: Document source is missing(文档 source 不存在)
Elasticsearch含义
操作需要文档的 _source 字段,但该字段未被存储。在禁用了 source 的索引上尝试执行需要 _source 的操作(例如部分更新、获取 source)。
原因
索引映射设置了 _source: {enabled: false};由于文档的原始 JSON 未被存储,部分更新、reindex 以及返回 _source 的查询都无法工作。为节省空间而禁用 source 的配置会导致此问题。
解决方法
需要 _source 的操作要求在映射中启用 source。创建新索引时,保持 _source 启用(默认即启用)。如果现有索引上 _source 已禁用,改为重新索引完整文档而不是更新它(用 index API 覆盖写入)。如需节省空间,考虑使用 _source 过滤(includes/excludes)或 synthetic _source,而不是完全禁用 source。
同一数据库的其他条目
- settings_exceptionInvalid settings(无效的设置)
- shard_not_found_exceptionShard not found(未找到分片)
- not_x_content_exceptionCompressor detection error / body is not valid content(压缩格式检测错误/请求体不是有效内容)
- node_not_connected_exceptionNode is not connected(节点未连接)
- receive_timeout_transport_exceptionRequest timed out waiting for a response from another node(等待另一节点响应时请求超时)
- routing_missing_exceptionRouting value is required for this document(此文档需要 routing 值)
- too_many_buckets_exceptionTrying to create too many buckets(试图创建过多的桶)