knowledgeGraphCreator.py 文件源码

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

项目:knowledge-graph 作者: MixedEmotions 项目源码 文件源码
def getKibiRelationConfig(indexName=".kibi", typeName="config" , elasticPort=9220, elasticHost="localhost"):
    es =  Elasticsearch([{'host': elasticHost, 'port': elasticPort}], http_auth=(elasticUsername, elasticPassword))
    mapping = es.search(
                index=indexName,
                doc_type=typeName,
                size=1000,
                request_timeout=1060,
                body={
                'query': {
                    'filtered': {
                      'query': {
                        'match_all': {}
                      }
                    }
                  }
                }
            )
    return mapping['hits']['hits'][0]
    #return mapping[SourceIndexName]["mappings"][SourceTypeName]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号