Csharp 消息是否在 .net 7 webAPI 中没有错误地发送到 Elasticsearch |
您所在的位置:网站首页 › webapi怎么用 › Csharp 消息是否在 .net 7 webAPI 中没有错误地发送到 Elasticsearch |
您可以获取response of the IndexDocument方法,并使用IsValid判断消息是否已正确发送.IsValid属性可用于判断响应在功能上是否有效. OriginalException.Message表示该方法返回的错误: var elkResponse = client.IndexDocument(new LogInfoModel("test1", "test1", "test1", DateTime.Now)); if (elkResponse.IsValid) { Console.WriteLine("message is sent without error."); } else { Console.WriteLine(elkResponse.OriginalException.Message); }此链接对您很有用indexing-documents-with-the-nest-elasticsearch-net-client |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |