|
16 | 16 | from redis.commands.search.query import GeoFilter, NumericFilter, Query
|
17 | 17 | from redis.commands.search.result import Result
|
18 | 18 | from redis.commands.search.suggestion import Suggestion
|
19 |
| -from tests.conftest import skip_ifmodversion_lt |
| 19 | +from tests.conftest import skip_if_redis_enterprise, skip_ifmodversion_lt |
20 | 20 |
|
21 | 21 | WILL_PLAY_TEXT = os.path.abspath(
|
22 | 22 | os.path.join(os.path.dirname(__file__), "testdata", "will_play_text.csv.bz2")
|
@@ -1043,3 +1043,22 @@ async def test_aggregations_sort_by_and_limit(modclient: redis.Redis):
|
1043 | 1043 | res = await modclient.ft().aggregate(req)
|
1044 | 1044 | assert len(res.rows) == 1
|
1045 | 1045 | assert res.rows[0] == ["t1", "b"]
|
| 1046 | + |
| 1047 | + |
| 1048 | +@pytest.mark.redismod |
| 1049 | +@skip_if_redis_enterprise() |
| 1050 | +async def test_search_commands_in_pipeline(modclient: redis.Redis): |
| 1051 | + p = await modclient.ft().pipeline() |
| 1052 | + p.create_index((TextField("txt"),)) |
| 1053 | + p.add_document("doc1", payload="foo baz", txt="foo bar") |
| 1054 | + p.add_document("doc2", txt="foo bar") |
| 1055 | + q = Query("foo bar").with_payloads() |
| 1056 | + await p.search(q) |
| 1057 | + res = await p.execute() |
| 1058 | + assert res[:3] == ["OK", "OK", "OK"] |
| 1059 | + assert 2 == res[3][0] |
| 1060 | + assert "doc1" == res[3][1] |
| 1061 | + assert "doc2" == res[3][4] |
| 1062 | + assert "foo baz" == res[3][2] |
| 1063 | + assert res[3][5] is None |
| 1064 | + assert res[3][3] == res[3][6] == ["txt", "foo bar"] |
0 commit comments