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

2017-05-04  本文已影响16人  imsilence

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

_mapping = self._connection.indices.get_mapping(indices=index)
# _mapping.get_doctype has bug
_doctypes = _mapping.get_doctypes(index)
return doctype in dict(_doctypes)
上一篇 下一篇

猜你喜欢

热点阅读