Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
<img src="//i.stack.imgur.com/RUiNP.png" height="16" width="18" alt="" class="sponsor tag img">elasticsearch 在elasticsearch中使用mserch查询排除索引名_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch_Kibana - Fatal编程技术网 elasticsearch 在elasticsearch中使用mserch查询排除索引名,elasticsearch,kibana,elasticsearch,Kibana" /> elasticsearch 在elasticsearch中使用mserch查询排除索引名,elasticsearch,kibana,elasticsearch,Kibana" />

elasticsearch 在elasticsearch中使用mserch查询排除索引名

elasticsearch 在elasticsearch中使用mserch查询排除索引名,elasticsearch,kibana,elasticsearch,Kibana,我正在使用elasticsearch通过msearch API获取多个索引的日志。 但我需要排除一些索引。假设我有a,b,c,d,e索引,但我不想包括索引b,c 我编写了elasticsearch查询来获取记录: GET _msearch? {"index":"*","size":100000,"exclude":["b","c"]} //used kibana to check indexes {"query":{}} //required to successfully run the

我正在使用elasticsearch通过msearch API获取多个索引的日志。 但我需要排除一些索引。假设我有a,b,c,d,e索引,但我不想包括索引b,c

我编写了elasticsearch查询来获取记录:

GET _msearch?
{"index":"*","size":100000,"exclude":["b","c"]}  //used kibana to check indexes
{"query":{}}  //required to successfully run the query
但我得到的记录包括索引b,c。我检查了文档,但没有得到任何适当的资源。
如何解决此问题???

此代码应实现以下功能:

GET _msearch?
{"index":"*,-b,-c","size":100000}
{"query":{}} 
注意
“index”
值中的负号(
-

尽管文档页面中没有明确提及,但它看起来像大多数支持多索引执行的API:

大多数引用索引参数的API都支持跨 多个索引,使用简单的test1、test2、test3符号(或_all表示 所有指数)。 它还支持通配符,例如:test*或test或tet或 测试,以及“排除”()的能力,例如:test*,-test3

一般来说,在多个索引上进行搜索是有困难的