elasticsearch 默认索引的Elasticsearch嵌套文档计数
我正在使用NEST进行Elasticsearch 6,希望获得默认索引的文档数 指的是API的1.1版本,该版本似乎不再工作 我已使用默认索引创建了连接设置:elasticsearch 默认索引的Elasticsearch嵌套文档计数,elasticsearch,nest,elasticsearch,Nest,我正在使用NEST进行Elasticsearch 6,希望获得默认索引的文档数 指的是API的1.1版本,该版本似乎不再工作 我已使用默认索引创建了连接设置: var connectionSettings = new ConnectionSettings().DefaultIndex("test_docs"); 当我尝试1.1 api文档中的代码时: var result = client.Count(); 我得到以下错误: 方法的类型参数 'ElasticClient.Count(Func
var connectionSettings = new ConnectionSettings().DefaultIndex("test_docs");
当我尝试1.1 api文档中的代码时:
var result = client.Count();
我得到以下错误:
方法的类型参数
'ElasticClient.Count(Func,IConRequest>)'
无法从用法推断。尝试指定类型参数
明确地说
当我提供一个类型时,它会附加到路径。例如:
client.Count<TestDocument>();
client.Count();
生成我真正需要的是您可以使用的
var countResponse = client.Count<TestDocument>(c => c.AllTypes());
你可以用
var countResponse = client.Count<TestDocument>(c => c.AllTypes());
谢谢这很有效,我没有意识到我需要包括AllTypesc。AllTypes()正在丢失银行!这很有效,我没有意识到我需要包含AllTypesc。缺少AllTypes()