Exemplo n.º 1
0
def test_scroll():
    client = Client(app_key, app_secret, base_url)
    indexSearch = Search(client)
    indexSearch.addIndex(index_name)
    # indexSearch.addSort('updated', const.SEARCH_SORT_DESC)
    indexSearch.fetch_fields = ['id', 'title', 'updated']
    indexSearch.query = "default:'opensearch'"
    indexSearch.addAggregate('created', 'count()')
    # indexSearch.addDistinct('owner_id')
    indexSearch.start = 0
    indexSearch.hits = 50
    ret = yield from indexSearch.scroll('1m', search_type='scan')
    print(ret)
    client.session.close()
    assert ret['status'] == 'OK'
def test_scroll():
    client = Client(app_key, app_secret, base_url, lib=client_name)
    indexSearch = Search(client)
    indexSearch.addIndex(index_name)
    indexSearch.fetch_fields = ['id', 'title', 'updated']
    indexSearch.query = "default:'opensearch'"
    indexSearch.addFilter('owner_id>=1')
    indexSearch.formula_name = 'default'
    indexSearch.first_formula_name = 'default'
    indexSearch.addSummary("text", length=100, element='em', ellipsis='...',
                           snipped=1, element_prefix='<em>', element_postfix='</em>')
    indexSearch.qp = 'stop_word'
    indexSearch.disable = 'qp'
    ret = indexSearch.scroll('1m', search_type='scan')
    print(ret)
    assert ret['status'] == 'OK'
def test_scroll():
    client = Client(app_key, app_secret, base_url, lib=client_name)
    indexSearch = Search(client)
    indexSearch.addIndex(index_name)
    indexSearch.fetch_fields = ["id", "title", "updated"]
    indexSearch.query = "default:'opensearch'"
    indexSearch.addFilter("owner_id>=1")
    indexSearch.formula_name = "default"
    indexSearch.first_formula_name = "default"
    indexSearch.addSummary(
        "text", length=100, element="em", ellipsis="...", snipped=1, element_prefix="<em>", element_postfix="</em>"
    )
    indexSearch.qp = "stop_word"
    indexSearch.disable = "qp"
    ret = indexSearch.scroll("1m", search_type="scan")
    print(ret)
    assert ret["status"] == "OK"
Exemplo n.º 4
0
def test_scroll():
    client = Client(app_key, app_secret, base_url, lib=client_name)
    indexSearch = Search(client)
    indexSearch.addIndex(index_name)
    indexSearch.fetch_fields = ['id', 'title', 'updated']
    indexSearch.query = "default:'opensearch'"
    indexSearch.addFilter('owner_id>=1')
    indexSearch.formula_name = 'default'
    indexSearch.first_formula_name = 'default'
    indexSearch.addSummary("text",
                           length=100,
                           element='em',
                           ellipsis='...',
                           snipped=1,
                           element_prefix='<em>',
                           element_postfix='</em>')
    indexSearch.qp = 'stop_word'
    indexSearch.disable = 'qp'
    ret = indexSearch.scroll('1m', search_type='scan')
    print(ret)
    assert ret['status'] == 'OK'