elasticsearch - _msearch api 无法正常工作
问题描述
我有一个具有多个索引和索引模式的弹性搜索集群。他们中的大多数工作正常。
但是对于一种日志索引,当我通过_msearch
api 查询并使用索引模式(比如a-index-*
)时,我得到一个空响应
{"responses":[{"took":0,"timed_out":false,"_shards":{"total":0,"successful":0,"skipped":0,"failed":0},"hits":{"total":0,"max_score":0,"hits":[]},"status":200}]}
如果我对索引本身(例如a-index-2019-10
)运行相同的查询,我会得到预期的响应。另外,如果我_search
对索引模式使用 api,则响应是正确的。
我正在使用 对此进行测试curl
,因此问题显然出在 elasticsearch 中,但我无法找出原因。
此查询(在索引上)返回结果
curl 'localhost:9200/_msearch' -H 'content-type: application/x-ndjson' --data $'{"index":["a-index-2019-10"]}\n{"version":true,"size":0,"query":{"match_all":{}}}\n'
此查询(在索引模式上)不返回任何结果
curl 'localhost:9200/_msearch' -H 'content-type: application/x-ndjson' --data $'{"index":["a-index-2019-10*"]}\n{"version":true,"size":0,"query":{"match_all":{}}}\n'
解决方案
推荐阅读
- javascript - ReferenceError:未定义味精+“解析错误:'返回'函数外
- node.js - SendGrid:设置环境变量不起作用
- c++ - 使用 lapacke_dgesv 在 cpp 中求解线性方程组
- android - 在第一种方法完成时改造调用第二种方法
- javascript - USB 条码扫描器重复扫描,无需服务器调用
- regex - Powershell 正则表达式用连字符替换下划线
- python - UBlox NAV_PVT 消息:UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb5
- html - 如何处理网站中服务器根目录上方的文件
- r - 是否可以在 R 中运行时设置函数的环境?
- ruby - 网络爬行。无法正确抓取数据