예제 #1
0
파일: EsDao.py 프로젝트: strongant/gsorglz
def send2esBulk(index, type, data):
    '''
    向ES中的某个type下新增批量数据
    '''
    execute = str.format('/{}/{}/_bulk', index, type)
    print execute
    result = httpPOST(config.ES_HOST, config.ES_PORT, execute, data)
    return result
예제 #2
0
파일: EsDao.py 프로젝트: strongant/gsorglz
def sendSingleObjToEs(index, type, data):
    '''
        index:索引名称
        type:表名称
        data:需要插入的数据
    '''
    execute = str.format('/{}/{}/', index, type)
    result = httpPOST(config.ES_HOST, config.ES_PORT, execute, data)
    return result