不要急,总有办法的

Elasticsearch用python如何查询索引信息

Elasticsearch | 作者 inter61 | 发布于2018年09月28日 | 阅读数:6652

 Elasticsearch用python如何查询索引信息
 
就是下面的信息,这个信息我是从web获取的到的,现在我想通过python程序获取到这个信息,没有找到合适的接口,请各位大神帮忙指导下,谢谢
 {"state": "open",
"settings": {

"index": {

"mapping": {

"nested_fields": {

"limit": "100"

}

},
"number_of_shards": "5",
"provided_name": "aitests",
"creation_date": "1526892832340",
"number_of_replicas": "1",
"uuid": "2NOLr0HLT_ey4A_ugqLpng",
"version": {

"created": "5060399"

}

}

},
"mappings": {

"kpi_datas": {

"properties": {

"subnetId": {

"copy_to": [

"enodebIndex"

],
"type": "text"

},
"eNodebId": {

"copy_to": [

"enodebIndex"

],
"type": "text"

},
"enodebIndex": {

"fielddata": true,
"type": "text"

},
"enodebId": {

"copy_to": [

"enodebIndex"

],
"type": "text"

},
"cellId": {

"copy_to": [

"enodebIndex"

],
"type": "text"

}

}

},
"aitest": {

"properties": {

"color1": {

"type": "text",
"fields": {

"keyword": {

"ignore_above": 256,
"type": "keyword"

}

}

},
"sold": {

"type": "date"

},
"color": {

"type": "text",
"fields": {

"keyword": {

"ignore_above": 256,
"type": "keyword"

}

}

},
"price": {

"type": "long"

},
"sold2": {

"type": "date"

},
"make11": {

"type": "text",
"fields": {

"keyword": {

"ignore_above": 256,
"type": "keyword"

}

}

},
"color11": {

"type": "text",
"fields": {

"keyword": {

"ignore_above": 256,
"type": "keyword"

}

}

},
"make": {

"type": "text",
"fields": {

"keyword": {

"ignore_above": 256,
"type": "keyword"

}

}

},
"make1": {

"type": "text",
"fields": {

"keyword": {

"ignore_above": 256,
"type": "keyword"

}

}

},
"price1": {

"type": "long"

},
"sold21": {

"type": "date"

}

}

},
"aitests": {

"properties": {

"color": {

"copy_to": [

"enodebIndex"

],
"type": "text"

},
"enodebIndex": {

"fielddata": true,
"type": "text"

},
"make": {

"copy_to": [

"enodebIndex"

],
"type": "text"

}

}

}

},
"aliases": [ ],
"primary_terms": {

"0": 5,
"1": 5,
"2": 5,
"3": 5,
"4": 5

},
"in_sync_allocations": {

"0": [

"Dtb_lkDLQhOpfoz17HF5NQ"

],
"1": [

"MZfWsEG2RGWEUStR2xMbMg"

],
"2": [

"OoSMDeOwQPqjuGswtHpzJg"

],
"3": [

"04HGb3EnQFKD8llzu0p5_g"

],
"4": [

"ZCdKLARCS1GvPYYo4VLd2w"

]

}}
已邀请:

inter61

赞同来自:

接口找到了
es.indices.get_mapping(self, index=None, doc_type=None, params=None)
 
这个可以获取mapping信息

要回复问题请先登录注册