Elasticsearch 在.net 中利用Nest进行检索问题

星空蔚蓝 2018-05-10 05:45:35

var node = new Uri("http://localhost:9200/");
var settings = new ConnectionSettings(node);
var client = new ElasticClient(settings);
var result = client.Search<Person>(s => s.Index("accounts"));


总是检索报错

Invalid NEST response built from a unsuccessful low level call on POST: /accounts/person/_search?typed_keys=true
# Audit trail of this API call:
- [1] BadResponse: Node: http://localhost:9200/ Took: 00:00:00.2356308
# OriginalException: System.Net.WebException: 远程服务器返回错误: (400) 错误的请求。
在 System.Net.HttpWebRequest.GetResponse()
在 Elasticsearch.Net.HttpConnection.Request[TResponse](RequestData requestData)
# 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:
<Response stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>

检索应该是get 为什么这里生成的是post呢?求大神帮忙
...全文
2261 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
*八步赶蝉* 2019-07-29
  • 打赏
  • 举报
回复
希望有人回答
xiaohe345 2019-05-14
  • 打赏
  • 举报
回复
我也遇到这个问题,
ElasticSeatch用的是7.0,
Nest 我试了好几个版本都不行,能问下你是如何解决的吗
星空蔚蓝 2018-05-11
  • 打赏
  • 举报
回复
自己知道问题了,是因为包引用的版本高于ES版本~结贴!

13,347

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 .NET技术前瞻
社区管理员
  • .NET技术前瞻社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧