Skip to content

Deprecate add_doccument (FT.ADD) #2425

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions redis/commands/search/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import time
from typing import Dict, Optional, Union

from deprecated import deprecated

from redis.client import Pipeline

from ..helpers import parse_to_dict
Expand Down Expand Up @@ -236,6 +238,9 @@ def _add_document_hash(

return self.execute_command(*args)

@deprecated(
version="2.0.0", reason="deprecated since redisearch 2.0, call hset instead"
)
def add_document(
self,
doc_id,
Expand Down Expand Up @@ -289,6 +294,9 @@ def add_document(
**fields,
)

@deprecated(
version="2.0.0", reason="deprecated since redisearch 2.0, call hset instead"
)
def add_document_hash(self, doc_id, score=1.0, language=None, replace=False):
"""
Add a hash document to the index.
Expand Down
Loading