当前位置: 首页>>代码示例>>Python>>正文


Python IndicesClient.get_settings方法代码示例

本文整理汇总了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")
开发者ID:zhaohangbo,项目名称:Time-Series-DBs-Benchmarks,代码行数:32,代码来源:put-setting-test.py

示例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))
开发者ID:kkrampa,项目名称:commcare-hq,代码行数:5,代码来源:elasticsearch-administer.py


注:本文中的elasticsearch.client.IndicesClient.get_settings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。