MCPcopy
hub / github.com/redis/redis-py / _add_document_hash

Method _add_document_hash

redis/commands/search/commands.py:1060–1078  ·  view source on GitHub ↗

Internal add_document_hash used for both batch and single doc indexing

(
        self, doc_id, conn=None, score=1.0, language=None, replace=False
    )

Source from the content-addressed store, hash-verified

1058 return self.execute_command(*args)
1059
1060 def _add_document_hash(
1061 self, doc_id, conn=None, score=1.0, language=None, replace=False
1062 ):
1063 """
1064 Internal add_document_hash used for both batch and single doc indexing
1065 """
1066
1067 args = [ADDHASH_CMD, self.index_name, doc_id, score]
1068
1069 if replace:
1070 args.append("REPLACE")
1071
1072 if language:
1073 args += ["LANGUAGE", language]
1074
1075 if conn is not None:
1076 return conn.execute_command(*args)
1077
1078 return self.execute_command(*args)
1079
1080 @deprecated_function(
1081 version="2.0.0", reason="deprecated since redisearch 2.0, call hset instead"

Callers 2

add_document_hashMethod · 0.95
add_document_hashMethod · 0.80

Calls 2

appendMethod · 0.45
execute_commandMethod · 0.45

Tested by

no test coverage detected