pyes问题记录1(判断doctype是否存在)

在通过pyes获取指定的doctype时不能通过mapping的get_doctype,只能通过get_doctypes获取index下的所有type,然后在自行过滤

1
2
3
4
_mapping = self._connection.indices.get_mapping(indices=index)
# _mapping.get_doctype has bug
_doctypes = _mapping.get_doctypes(index)
return doctype in dict(_doctypes)