报错记录

  1. Caused by: org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]
  2. {"error":{"root_cause":[{"type":"query_shard_exception","reason":"failed to create query: For input string: \"false\"","index_uuid":"x_E7kq8bQ4CdQVJfJuWQTQ","index":"hrod_platform_mirror_emp_to_es_1"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"hrod_platform_mirror_emp_to_es_1","node":"CENhhtY6RTa8JVfkM_7uow","reason":{"type":"query_shard_exception","reason":"failed to create query: For input string: \"false\"","index_uuid":"x_E7kq8bQ4CdQVJfJuWQTQ","index":"hrod_platform_mirror_emp_to_es_1","caused_by":{"type":"number_format_exception","reason":"For input string: \"false\""}}}]},"status":400}

原因是数据类型弄错了.

es 某个字段是数字类型, 我Java代码查询es的时候这个字段传的是 Boolean类型的 false ,所以报错了,

Caused by: org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=search_phase_execution_exception, reaso - 图1

解决办法是 让es字段的数据类型和你Java代码查询的参数数据类型一致