本文整理汇总了Python中elasticsearch.client.IndicesClient.get_settings方法的典型用法代码示例。如果您正苦于以下问题:Python IndicesClient.get_settings方法的具体用法?Python IndicesClient.get_settings怎么用?Python IndicesClient.get_settings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类elasticsearch.client.IndicesClient
的用法示例。
在下文中一共展示了IndicesClient.get_settings方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from elasticsearch.client import IndicesClient [as 别名]
# 或者: from elasticsearch.client.IndicesClient import get_settings [as 别名]
def main():
# Define the globals
global index_names
global STARTED_TIMESTAMP
global es
global es_indices
try:
# Initiate the elasticsearch session using ES low-level client.
# By default nodes are randomized before passed into the pool and round-robin strategy is used for load balancing.
es = Elasticsearch(ES_HOSTS, timeout=30)
es_indices = IndicesClient(es)
except:
print("Could not connect to elasticsearch!")
sys.exit(1)
print("Creating indices.. \n"),
indices = generate_indices()
print("Done!\n")
print("GET Settings \n"),
print json.dumps(es_indices.get_settings(index="_all"), sort_keys=True,indent=4, separators=(',', ': '))
print("Done!\n")
# We will Clean up the indices by default
# Default: True
if CLEANUP:
print("Cleaning up created indices.. "),
cleanup_indices()
print("Done!\n")
示例2: index_settings
# 需要导入模块: from elasticsearch.client import IndicesClient [as 别名]
# 或者: from elasticsearch.client.IndicesClient import get_settings [as 别名]
def index_settings(es):
indices = IndicesClient(es)
pprint(indices.get_settings(flat_settings=True))