search_phase_execution_exception: search_phase_execution_exception: all shards failed / Failed to execute phase [query](所有分片均失败 / 执行 [query] 阶段失败)
Elasticsearch含义
搜索请求在一个或全部所需分片上失败。这是一个包装了实际底层原因的通用搜索错误;"caused by" 部分说明了真正的问题(解析错误、熔断器、字段类型不合适、分片不可达等)。
原因
查询语法无效、在错误的字段类型上聚合、too_many_clauses、熔断器触发、分片未分配/不可达、查询超时或节点崩溃。根本原因在响应的内层异常中。
解决方法
在响应的 "caused by" / "failed_shards" 详情中找到实际异常并相应修正(修正查询、使用 keyword 字段、熔断器/堆设置、分片分配)。检查集群健康状况:GET _cluster/health 和 GET _cat/shards?v。如果允许部分结果且部分分片失败,检查 allow_partial_search_results 行为。
同一数据库的其他条目
- mapper_parsing_exceptionmapper_parsing_exception: failed to parse field [...] of type [...](无法解析类型为 [...] 的字段 [...])
- strict_dynamic_mapping_exceptionstrict_dynamic_mapping_exception: mapping set to strict, dynamic introduction of [...] within [...] is not allowed(mapping 设为 strict,不允许动态添加字段)
- illegal_argument_exception_fielddataillegal_argument_exception: Fielddata is disabled on text fields by default. Set fielddata=true on [your_field] in order to load fielddata in memory(text 字段默认禁用 fielddata)
- too_many_clausestoo_many_clauses: maxClauseCount is set to 1024 (query contains too many clauses)(查询包含的子句过多)
- version_conflict_engine_exceptionversion_conflict_engine_exception: [_doc][id]: version conflict, current version [x] is different than the one provided [y] (HTTP 409)(版本冲突,当前版本与提供的版本不同)
- document_missing_exceptiondocument_missing_exception: [_doc][id]: document missing(文档不存在)
- index_not_found_exceptionindex_not_found_exception: no such index [index_name] (HTTP 404)(索引不存在)