(self, decoded_r: redis.Redis)
| 623 | |
| 624 | @pytest.mark.redismod |
| 625 | async def test_no_index(self, decoded_r: redis.Redis): |
| 626 | await decoded_r.ft().create_index( |
| 627 | ( |
| 628 | TextField("field"), |
| 629 | TextField("text", no_index=True, sortable=True), |
| 630 | NumericField("numeric", no_index=True, sortable=True), |
| 631 | GeoField("geo", no_index=True, sortable=True), |
| 632 | TagField("tag", no_index=True, sortable=True), |
| 633 | ) |
| 634 | ) |
| 635 | |
| 636 | await decoded_r.hset( |
| 637 | "doc1", |
| 638 | mapping={ |
| 639 | "field": "aaa", |
| 640 | "text": "1", |
| 641 | "numeric": "1", |
| 642 | "geo": "1,1", |
| 643 | "tag": "1", |
| 644 | }, |
| 645 | ) |
| 646 | await decoded_r.hset( |
| 647 | "doc2", |
| 648 | mapping={ |
| 649 | "field": "aab", |
| 650 | "text": "2", |
| 651 | "numeric": "2", |
| 652 | "geo": "2,2", |
| 653 | "tag": "2", |
| 654 | }, |
| 655 | ) |
| 656 | await self.waitForIndex(decoded_r, "idx") |
| 657 | |
| 658 | if expects_resp2_shape(decoded_r) or expects_unified_shape(decoded_r): |
| 659 | res = await decoded_r.ft().search(Query("@text:aa*")) |
| 660 | assert 0 == res.total |
| 661 | |
| 662 | res = await decoded_r.ft().search(Query("@field:aa*")) |
| 663 | assert 2 == res.total |
| 664 | |
| 665 | res = await decoded_r.ft().search(Query("*").sort_by("text", asc=False)) |
| 666 | assert 2 == res.total |
| 667 | assert "doc2" == res.docs[0].id |
| 668 | |
| 669 | res = await decoded_r.ft().search(Query("*").sort_by("text", asc=True)) |
| 670 | assert "doc1" == res.docs[0].id |
| 671 | |
| 672 | res = await decoded_r.ft().search(Query("*").sort_by("numeric", asc=True)) |
| 673 | assert "doc1" == res.docs[0].id |
| 674 | |
| 675 | res = await decoded_r.ft().search(Query("*").sort_by("geo", asc=True)) |
| 676 | assert "doc1" == res.docs[0].id |
| 677 | |
| 678 | res = await decoded_r.ft().search(Query("*").sort_by("tag", asc=True)) |
| 679 | assert "doc1" == res.docs[0].id |
| 680 | elif expects_resp3_shape(decoded_r): |
| 681 | res = await decoded_r.ft().search(Query("@text:aa*")) |
| 682 | assert 0 == res["total_results"] |
nothing calls this directly
no test coverage detected