ElasticSearch 如何过滤或排除错误字段?

How can filter or exclude error fields in ElasticSearch?

异常情况下是否可以减少错误响应?

我正在尝试只获取一些字段,例如error.reason。我需要可以操纵错误响应结构。 有可能的? 谢谢

错误是elastic中确实没有索引。 仔细查看您的索引和查询

索引名称 -> aho_bas 查询中的索引名称-> aaho_bas

查询:curl -v "localhost:9200/aaho_bas/_search?filter_path=took

由于不存在具有该名称的索引,这就是错误的根源。

我找到了解决方法:在 elasticsearch.yml 属性 文件中设置 http.detailed_errors.enabled: false。 这样做,如果出现异常,错误响应为:

{ "error" : "IndexNotFoundException[no such index]", "status":404 }

这是一个更简单的回应