python-2.7 - 等价于python中的 `GET _mapping`奇迹/感觉?

标签 python-2.7 elasticsearch get elasticsearch-plugin

我正在尝试使用python探索Elasticsearch集群,而我是Elasticsearch的新手。如果使用Marvel / Sense,则可以使用GET _mapping查看集群的架构。在Python中有等效的方法吗?如果是这样,我可以看到集群的“架构”!

更笼统地说,我想以编程方式发现所有索引,每个索引的doc_types,对doc_types的字段进行分类(它们是文本字符串,整数,浮点数,数字取值范围是什么..),基本上都可以学习模式并每个字段的基本统计信息。如果有比GET _mapping更好的方法来启动这个项目,我全神贯注。

这与this question有关,他们在其中使用Python寻找索引列表,但更为笼统。

最佳答案

您可以使用pyelasticsearch做到这一点。 This是你怎么做GET _mapping在python中。

来自文档

get_mapping(index=None, doc_type=None) [source]

Fetch the mapping definition for a specific index and type.

Parameters:

  • index – An index or iterable thereof

  • doc_type – A document type or iterable thereof

Omit both arguments to get mappings for all types and indexes.



探索API了解更多

关于python-2.7 - 等价于python中的 `GET _mapping`奇迹/感觉?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33748920/

相关文章:

python-2.7 - 关于没有 Root 访问权限的 easy_install 的一些困惑

python - 嵌套格式规范合法吗?

mysql - 适用于 Python 的格式正确的 Mysql 查询

python - 如何快速查单?

java - Elastic Search 前缀、后缀、EdgeGram

javascript - PHP $_Get 和 JQuery .load

java - 隐藏从url发送参数

c#-4.0 - 使用C#在其中具有空格和特殊字符的Elastic Search-Search字符串

elasticsearch - Elasticsearch :查询字符串和数字并不总是返回所需结果

java - 将字符“替换为无文本然后将值转换为 Float 时出现空指针异常