美文网首页
pyes问题记录(判断doctype是否存在)

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

作者: imsilence | 来源:发表于2017-05-04 12:53 被阅读16次

在通过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)

相关文章

网友评论

      本文标题: pyes问题记录(判断doctype是否存在)

      本文链接:https://www.haomeiwen.com/subject/wzirtxtx.html