elasticsearch - Elasticsearch .NET DocumentExists() 返回错误:从 HEAD 上的不成功 (200) 低级别调用构建的无效 NEST 响应
问题描述
我有一个文档已经存在于下面的弹性索引中
这是我的 C# 代码,用于检查此文档是否存在:
ExistsResponse existsResponse = await _elasticClient.DocumentExistsAsync<T>(type.Id, d =>
d.Index(index));
但是,每当程序运行到该行时,它总是返回一个带有无效 NEST 响应的错误:(我用 xxxx 将我的节点域地址变灰)
Invalid NEST response built from a unsuccessful (200) low level call on HEAD: /purchaseorders_test/_doc/PO1Z74FVF4
# Audit trail of this API call:
- [1] BadResponse: Node: https://xxxxxxxxx/ Took: 00:00:00.3388193
# OriginalException: Elasticsearch.Net.ElasticsearchClientException: Request failed to execute. Call: Status code 200 from: HEAD /purchaseorders_test/_doc/PO1Z74FVF4
# Request:
<Request stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>
# Response:
我已经设置好DisableDirectStreaming
了ConnectionSettings
,但他们似乎没有解决任何问题
var settings = new ConnectionSettings(new Uri(url))
.DefaultIndex(defaultIndex).BasicAuthentication("elastic", "xxxxxxx").DisableDirectStreaming();
var client = new ElasticClient(settings);
我使用的 Elastic NUGET 版本是Elasticsearch.Net 7.13.0
我不知道如何解决这个问题,有人可以帮我解决这个问题吗?
解决方案
推荐阅读
- python - 我在 CS50 Lab 6 中的代码发生了什么问题,我该如何解决?
- javascript - ExtJS Modern - 向网格单元添加多个按钮
- javascript - 如何构建 tensorflow.js 模型来预测数字的平方?
- terraform - 如何解决创建服务时出错:googleapi:错误 403:服务帐户上的权限“iam.serviceaccounts.actAs”被拒绝
- rust - 使用 serde 反序列化带有 Enum 键的 HashMap
- angular - WINDOWS 上的 WebSerial API - “DOMException:无法打开串行端口。”
- python - 从字典中获取键的最有效方法
- node.js - 回滚后的 Mikroorm id 漏洞
- docker - 添加第二个 EF 核心数据库后 Blazor 服务器端 docker 容器分段错误
- asp.net-core - 在 asp.net core 中模拟用户