(self, client)
| 881 | |
| 882 | @pytest.mark.redismod |
| 883 | def test_alter_schema_add(self, client): |
| 884 | # Creating the index definition and schema |
| 885 | client.ft().create_index(TextField("title")) |
| 886 | |
| 887 | # Using alter to add a field |
| 888 | client.ft().alter_schema_add(TextField("body")) |
| 889 | |
| 890 | # Indexing a document |
| 891 | client.hset( |
| 892 | "doc1", |
| 893 | mapping={"title": "MyTitle", "body": "Some content only in the body"}, |
| 894 | ) |
| 895 | |
| 896 | # Searching with parameter only in the body (the added field) |
| 897 | q = Query("only in the body") |
| 898 | |
| 899 | # Ensure we find the result searching on the added body field |
| 900 | res = client.ft().search(q) |
| 901 | if expects_resp2_shape(client) or expects_unified_shape(client): |
| 902 | assert 1 == res.total |
| 903 | elif expects_resp3_shape(client): |
| 904 | assert 1 == res["total_results"] |
| 905 | |
| 906 | @pytest.mark.redismod |
| 907 | def test_spell_check(self, client): |
nothing calls this directly
no test coverage detected