相当于“GET _mapping”的奇迹/感觉在Python中? [英] Equivalent of `GET _mapping` marvel/sense in Python?
问题描述
GET _mapping
查看集群的模式。在Python中有相当的方法吗?如果是这样,我可以看到集群的架构! 更一般来说,我想以编程方式发现所有的指标,每个索引的doc_types都将doc_types分类'字段(它们是文本字符串,int,float,数字的范围,...)基本上学习每个字段的模式和基本统计信息。如果有一个比 GET _mapping
更好的方式来启动这个项目,我就是耳朵。
这与这个问题,他们正在使用Python寻找索引列表,但更为通用。
你可以用pyelasticsearch做到这一点。 这个是如何做的code> GET _mapping
在python中。
从文档
get_mapping(index = None,doc_type = None) [来源]
获取特定索引的映射定义并键入。
参数:
index - 索引或可迭代
doc_type - 文档类型或可迭代的
省略两个参数以获取所有类型和索引的映射。
浏览 API 了解详情
I'm trying to explore an elasticsearch cluster using python, and I'm new to elasticsearch. If I use Marvel/Sense, I can see the cluster's schema using GET _mapping
. Is there an equivalent way to do this in Python? If so I can see the "schema" of the cluster!
More generally, I'd like to discover programmatically all the indicies, each indices' doc_types, classify the doc_types' fields (are they text strings, ints, floats, what range to the numeric ones take, ..) basically learn the schema and basic statistics of each field. If there is a better way than GET _mapping
to start this project, I'm all ears.
This is related to this question, where they are looking for a list of indices using Python, but is more general.
You can do that with pyelasticsearch. This is how you can do GET _mapping
in python.
From the Docs
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.
Explore API to learn more
这篇关于相当于“GET _mapping”的奇迹/感觉在Python中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!