【问题标题】:NEST API call getting 404 Not Found with good queryNEST API 调用得到 404 Not Found 且查询良好
【发布时间】:2017-08-24 16:05:29
【问题描述】:

我正在使用 NEST 查询 Elastic 5.4 实例并收到以下错误。我有所有的 DebugInformation() 并且在 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"}

【问题讨论】:

  • 您是否向正确的端口 (9200) 发出请求?这绝对不是您的查询的问题。
  • 发布后我意识到我有 Kibana 的端口,而不是弹性的 9200。 #facepalm。感谢您的回复

标签: elasticsearch kibana nest


【解决方案1】:

就我而言,这是一个简单的愚蠢错误。我在 API 连接字符串中有 Kibana 端口。然而,NEST 给出的回报在我看来是成功的,但弹性返回了 404。对于将来可能发生这种情况的任何人,请注意。确保您的连接字符串。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-15
    • 1970-01-01
    • 2023-03-18
    • 2011-01-24
    • 1970-01-01
    • 2019-06-16
    相关资源
    最近更新 更多