我在我的应用程序中使用elasticsearch js,并已成功连接和查询来自 elastic 的数据。
我现在正在尝试实现该count()
方法以返回索引中的文档数。这是简单的代码片段:
elasticClient.count(/* params: CountParams */)
我替换params: CountParams
为,indexName
但我现在收到一个非法参数异常,说... [/_count] contains unrecognized parameters ...
我在任何地方都找不到关于计数方法的任何文档,无论是在 api、堆栈溢出还是在其他站点上。
如果有人能提供一个工作示例或任何链接,我将不胜感激。
谢谢!