elasticsearch.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:jamdb 作者: CenterForOpenScience 项目源码 文件源码
def __init__(self, index, doc_type, connection=None):
        self._connection = connection or ElasticsearchBackend.DEFAULT_CONNECTION
        self._index = index
        self._doc_type = doc_type
        self._connection.indices.create(self._index, ignore=400)
        self._connection.indices.put_mapping(body={doc_type: self.ES_MAPPING}, index=index, doc_type=doc_type)
        self.search = elasticsearch_dsl.Search(self._connection, index=index, doc_type=doc_type)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号