def test_update():
    client = Client(app_key, app_secret, base_url, lib=client_name)
    indexDoc = IndexDoc(client, index_name)
    doc = {
        "id": doc_id, "title": "这是一个测试标题的[修改]", "text": "这是一个测试标题的修改 OpenSearch"}
    ret = indexDoc.add(doc, table_name)
    assert ret['status'] == 'OK'
def doc_add(docs):
    client = Client(app_key, app_secret, base_url, lib=client_name)
    indexDoc = IndexDoc(client, index_name)
    ret = indexDoc.add(docs, table_name)
    assert ret['status'] == 'OK'
    print(ret)
    time.sleep(10)
def test_adds():
    client = Client(app_key, app_secret, base_url, lib=client_name)
    indexDoc = IndexDoc(client, index_name)

    docs = []
    item = {}
    item['id'] = 2
    item['owner_id'] = 2
    item['catalog_id'] = [11, 56]
    item['title'] = u"阿里云开源众包计划 - OpenSearch C++ SDK 开发"
    item['text'] = u"阿里云开源众包计划 - OpenSearch C++ SDK 开发 100%实现阿里云OpenSearch的C++语言SDK 需要跨Windows、Linux、MacOS三个平台"
    item['updated'] = 1439514278
    item['created'] = 1439514278
    docs.append(item)

    item = {}
    item['id'] = 3
    item['owner_id'] = 1
    item['catalog_id'] = [12, 34]
    item['title'] = u"阿里云开源众包计划 - OpenSearch Python SDK 开发"
    item['text'] = u"阿里云开源众包计划 - OpenSearch Python SDK 开发 项目结束后,开发者需要继续三个月的bug维护期"
    item['updated'] = 1439514278
    item['created'] = 1439514278
    docs.append(item)

    ret = indexDoc.add(docs, table_name)
    assert ret['status'] == 'OK'
    time.sleep(5)
def doc_update():
    client = Client(app_key, app_secret, base_url, lib=client_name)
    indexDoc = IndexDoc(client, index_name)
    doc = {"id": doc_id, "title": "this is a test title [modify]", "text": "this is a test title [modify] OpenSearch"}
    ret = indexDoc.add(doc, table_name)
    time.sleep(2)
    print('update doc status: ', ret['status'])
def test_adds():
    client = Client(app_key, app_secret, base_url, lib=client_name)
    indexDoc = IndexDoc(client, index_name)

    docs = []
    item = {}
    item['id'] = 2
    item['owner_id'] = 2
    item['catalog_id'] = [11, 56]
    item['title'] = u"阿里云开源众包计划 - OpenSearch C++ SDK 开发"
    item[
        'text'] = u"阿里云开源众包计划 - OpenSearch C++ SDK 开发 100%实现阿里云OpenSearch的C++语言SDK 需要跨Windows、Linux、MacOS三个平台"
    item['updated'] = 1439514278
    item['created'] = 1439514278
    docs.append(item)

    item = {}
    item['id'] = 3
    item['owner_id'] = 1
    item['catalog_id'] = [12, 34]
    item['title'] = u"阿里云开源众包计划 - OpenSearch Python SDK 开发"
    item[
        'text'] = u"阿里云开源众包计划 - OpenSearch Python SDK 开发 项目结束后,开发者需要继续三个月的bug维护期"
    item['updated'] = 1439514278
    item['created'] = 1439514278
    docs.append(item)

    ret = indexDoc.add(docs, table_name)
    assert ret['status'] == 'OK'
    time.sleep(5)
Пример #6
0
def doc_add(docs):
    client = Client(app_key, app_secret, base_url, lib=client_name)
    indexDoc = IndexDoc(client, index_name)
    ret = indexDoc.add(docs, table_name)
    assert ret['status'] == 'OK'
    print(ret)
    time.sleep(10)
def test_update():
    client = Client(app_key, app_secret, base_url)
    indexDoc = IndexDoc(client, index_name)
    doc = {"id": doc_id, "title": "这是一个测试标题的[修改]", "text": "这是一个测试标题的修改 OpenSearch"}
    ret = yield from indexDoc.add(doc, table_name)
    client.session.close()
    assert ret['status'] == 'OK'
    time.sleep(5)
def test_add():
    client = Client(app_key, app_secret, base_url)
    indexDoc = IndexDoc(client, index_name)
    doc = {"id": doc_id, "title": u"这是一个测试标题", "text": u"这是一个测试标题 OpenSearch", "updated": 1439514278, "created": 1439514278}
    ret = yield from indexDoc.add(doc, table_name)
    client.session.close()
    assert ret['status'] == 'OK'
    time.sleep(5)
def doc_update():
    client = Client(app_key, app_secret, base_url)
    indexDoc = IndexDoc(client, index_name)
    doc = {"id": doc_id, "title": "this is a test title [modify]", "text": "this is a test title [modify] OpenSearch"}
    ret = yield from indexDoc.add(doc, table_name)
    client.session.close()
    time.sleep(5)
    print('update doc status: ', ret['status'])
def doc_update():
    client = Client(app_key, app_secret, base_url, lib=client_name)
    indexDoc = IndexDoc(client, index_name)
    doc = {
        "id": doc_id,
        "title": "this is a test title [modify]",
        "text": "this is a test title [modify] OpenSearch"
    }
    ret = indexDoc.add(doc, table_name)
    time.sleep(2)
    print('update doc status: ', ret['status'])
Пример #11
0
def test_update():
    client = Client(app_key, app_secret, base_url, lib=client_name)
    indexDoc = IndexDoc(client, index_name)
    doc = {
        "id": doc_id,
        "title": "这是一个测试标题的[修改]",
        "text": "这是一个测试标题的修改 OpenSearch"
    }
    ret = indexDoc.add(doc, table_name)
    assert ret['status'] == 'OK'
    time.sleep(5)
Пример #12
0
def doc_update():
    client = Client(app_key, app_secret, base_url)
    indexDoc = IndexDoc(client, index_name)
    doc = {
        "id": doc_id,
        "title": "this is a test title [modify]",
        "text": "this is a test title [modify] OpenSearch"
    }
    ret = yield from indexDoc.add(doc, table_name)
    client.session.close()
    time.sleep(5)
    print('update doc status: ', ret['status'])
Пример #13
0
def test_add():
    client = Client(app_key, app_secret, base_url, lib=client_name)
    indexDoc = IndexDoc(client, index_name)
    doc = {
        "id": doc_id,
        "title": u"这是一个测试标题",
        "text": u"这是一个测试标题 OpenSearch",
        "updated": 1439514278,
        "created": 1439514278
    }
    ret = indexDoc.add(doc, table_name)
    assert ret['status'] == 'OK'
    time.sleep(5)
def doc_add():
    client = Client(app_key, app_secret, base_url)
    indexDoc = IndexDoc(client, index_name)
    doc = {}
    doc['id'] = doc_id
    doc['owner_id'] = 1
    doc['catalog_id'] = [12, 34]
    doc['title'] = u"this is a test title"
    doc['text'] = u"this is a test title OpenSearch"
    doc['updated'] = 1439514278
    doc['created'] = 1439514278
    ret = yield from indexDoc.add(doc, table_name)
    client.session.close()
    time.sleep(5)
    print('add doc status: ', ret['status'])
def doc_add():
    # client = Client(app_key, app_secret, base_url)
    client = Client(app_key, app_secret, base_url, lib=client_name)
    indexDoc = IndexDoc(client, index_name)
    doc = {}
    doc['id'] = doc_id
    doc['owner_id'] = 1
    doc['catalog_id'] = [12, 34]
    doc['title'] = u"this is a test title"
    doc['text'] = u"this is a test title OpenSearch"
    doc['updated'] = 1439514278
    doc['created'] = 1439514278
    ret = indexDoc.add(doc, table_name)
    time.sleep(2)
    print('add doc status: ', ret['status'])