Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.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
Python 2.7 Elasticsearch-查找索引模式_Python 2.7_Rally_<img Src="//i.stack.imgur.com/A3TTx.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch 5_Pyral - Fatal编程技术网 elasticsearch-5,pyral,Python 2.7,Rally,elasticsearch 5,Pyral" /> elasticsearch-5,pyral,Python 2.7,Rally,elasticsearch 5,Pyral" />

Python 2.7 Elasticsearch-查找索引模式

Python 2.7 Elasticsearch-查找索引模式,python-2.7,rally,elasticsearch-5,pyral,Python 2.7,Rally,elasticsearch 5,Pyral,我正在使用Python脚本从Rally API获取数据,对其进行操作并发送到Elasticsearch。 我正在试图找出如何在脚本代码中找到我的存在索引。我的ES实例非常简单: es = Elasticsearch([{'host': 'myIP', 'port': 9200}]) 在此实例中,我找不到存在索引的位置 我的目的是说明更新索引数据的条件 有什么想法吗 tnx好的,我找到了解决方案,而且使用起来非常简单。仅键入: from elasticsearch import Elastics

我正在使用Python脚本从Rally API获取数据,对其进行操作并发送到Elasticsearch。 我正在试图找出如何在脚本代码中找到我的存在索引。我的ES实例非常简单:

es = Elasticsearch([{'host': 'myIP', 'port': 9200}])
在此实例中,我找不到存在索引的位置

我的目的是说明更新索引数据的条件

有什么想法吗


tnx

好的,我找到了解决方案,而且使用起来非常简单。仅键入:

from elasticsearch import Elasticsearch 

es = Elasticsearch([{'host': 'host_ip', 'port': 9200}])

if es.indices.exists(index = 'index_name') 
 #set a condition here