Skip to content

Commit 9a460c8

Browse files
authored
Deprecate add_doccument (FT.ADD) (#2425)
* deprecate add_doccuments * linters * linters * async tests
1 parent d95e004 commit 9a460c8

File tree

3 files changed

+178
-369
lines changed

3 files changed

+178
-369
lines changed

redis/commands/search/commands.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import time
33
from typing import Dict, Optional, Union
44

5+
from deprecated import deprecated
6+
57
from redis.client import Pipeline
68

79
from ..helpers import parse_to_dict
@@ -236,6 +238,9 @@ def _add_document_hash(
236238

237239
return self.execute_command(*args)
238240

241+
@deprecated(
242+
version="2.0.0", reason="deprecated since redisearch 2.0, call hset instead"
243+
)
239244
def add_document(
240245
self,
241246
doc_id,
@@ -289,6 +294,9 @@ def add_document(
289294
**fields,
290295
)
291296

297+
@deprecated(
298+
version="2.0.0", reason="deprecated since redisearch 2.0, call hset instead"
299+
)
292300
def add_document_hash(self, doc_id, score=1.0, language=None, replace=False):
293301
"""
294302
Add a hash document to the index.

0 commit comments

Comments
 (0)