NEST API 调用通过良好的查询获得 404 未找到



我正在使用 NEST 查询 Elastic 5.4 实例并收到以下错误。 我拥有所有的调试信息((,当在 Kibana 的 DevTools 中运行查询时,一切都很好,我得到了结果。 我不认为这是一个超时问题,因为请求似乎已完成并给出响应,但希望对此有第二双眼睛。 这是我的Serilog输出。 这是使用 ASP.NET Core 运行原始查询。 提前感谢您的帮助。

2017-08-24 10:48:58.723 -05:00 [Debug] ElasticController:Index
2017-08-24 10:48:58.921 -05:00 [Debug] ElasticService.QueryInstanceTail: elasticQuery { "bool": { "filter": [ { "term":  { "instance_num": "99999999" }}, { "range":  { "@timestamp": { "gte": "2017-08-22T15:48:00Z", "lte": "2017-08-22T16:48:00Z" } } } ] } }
2017-08-24 10:48:58.922 -05:00 [Debug] ElasticService.QueryInstanceTail: searchResponse 0 : Invalid NEST response built from a unsuccessful low level call on POST: /filebeat-%2A/_search
# Audit trail of this API call:
- [1] BadResponse: Node: http://devserver.local:5601/ Took: 00:00:00.1976977
# ServerError: ServerError: -1Type:  Reason: "Not Found"
# Request:
{"from":0,"size":60,"query":{ "bool": { "filter": [ { "term":  { "instance_num": "99999999" }}, { "range":  { "@timestamp": { "gte": "2017-08-22T15:48:00Z", "lte": "2017-08-22T16:48:00Z" } } } ] } }
# Response:
{"statusCode":404,"error":"Not Found"}

我犯了简单的笨蛋错误。我在 API 连接字符串中有 Kibana 端口。然而,在我看来,NEST 给出的回报是成功的,但弹性返回了 404。 只是给将来可能发生这种情况的任何人的注释。 确保连接字符串。

最新更新