(self, decoded_r: redis.Redis)
| 549 | |
| 550 | @pytest.mark.redismod |
| 551 | async def test_example(self, decoded_r: redis.Redis): |
| 552 | # Creating the index definition and schema |
| 553 | await decoded_r.ft().create_index( |
| 554 | (TextField("title", weight=5.0), TextField("body")) |
| 555 | ) |
| 556 | |
| 557 | # Indexing a document |
| 558 | await decoded_r.hset( |
| 559 | "doc1", |
| 560 | mapping={ |
| 561 | "title": "RediSearch", |
| 562 | "body": "Redisearch impements a search engine on top of redis", |
| 563 | }, |
| 564 | ) |
| 565 | |
| 566 | # Searching with complex parameters: |
| 567 | q = Query("search engine").verbatim().no_content().paging(0, 5) |
| 568 | |
| 569 | res = await decoded_r.ft().search(q) |
| 570 | assert res is not None |
| 571 | |
| 572 | @pytest.mark.redismod |
| 573 | async def test_auto_complete(self, decoded_r: redis.Redis): |
nothing calls this directly
no test coverage detected