Internal add_document_hash used for both batch and single doc indexing
(
self, doc_id, conn=None, score=1.0, language=None, replace=False
)
| 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" |
no test coverage detected