|
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 | pytestmark = pytest.mark.asyncio
|
22 | 22 |
|
@@ -1046,3 +1046,22 @@ async def test_aggregations_sort_by_and_limit(modclient: redis.Redis):
|
1046 | 1046 | res = await modclient.ft().aggregate(req)
|
1047 | 1047 | assert len(res.rows) == 1
|
1048 | 1048 | assert res.rows[0] == ["t1", "b"]
|
| 1049 | + |
| 1050 | + |
| 1051 | +@pytest.mark.redismod |
| 1052 | +@skip_if_redis_enterprise() |
| 1053 | +async def test_search_commands_in_pipeline(modclient: redis.Redis): |
| 1054 | + p = await modclient.ft().pipeline() |
| 1055 | + p.create_index((TextField("txt"),)) |
| 1056 | + p.add_document("doc1", payload="foo baz", txt="foo bar") |
| 1057 | + p.add_document("doc2", txt="foo bar") |
| 1058 | + q = Query("foo bar").with_payloads() |
| 1059 | + await p.search(q) |
| 1060 | + res = await p.execute() |
| 1061 | + assert res[:3] == ["OK", "OK", "OK"] |
| 1062 | + assert 2 == res[3][0] |
| 1063 | + assert "doc1" == res[3][1] |
| 1064 | + assert "doc2" == res[3][4] |
| 1065 | + assert "foo baz" == res[3][2] |
| 1066 | + assert res[3][5] is None |
| 1067 | + assert res[3][3] == res[3][6] == ["txt", "foo bar"] |
0 commit comments