【发布时间】:2020-01-06 19:30:50
【问题描述】:
使用 NEST v6.4.2
我需要使用 client.Get API 来获取一个搜索所有索引而不是一个索引的文档。
我的代码如下:
var client = // intiialize elasticsearch client here
var id = // some document id
// the call to client.Get below fails as "" is not a valid index name
// I have also tried passing "*", Indicies.All, Indices.AllIndices, etc but nothing works
var document = client.Get<dynamic>(new GetRequest("", "_all", id));
以前有人做过吗?文档似乎表明您可以使用 client.Search API 执行此操作,但这对于检索单个文档并不是最佳选择,因此我希望尽可能避免。
谢谢
【问题讨论】:
标签: c# elasticsearch nest