Load a single document by id - **field_encodings**: optional dict mapping field names to encodings. If a field's encoding is ``None`` the raw bytes value is preserved (useful for binary data such as vectors).
(self, id, field_encodings: Optional[Dict[str, Any]] = None)
| 1174 | return self.execute_command(*args) |
| 1175 | |
| 1176 | def load_document(self, id, field_encodings: Optional[Dict[str, Any]] = None): |
| 1177 | """ |
| 1178 | Load a single document by id |
| 1179 | |
| 1180 | - **field_encodings**: optional dict mapping field names to encodings. |
| 1181 | If a field's encoding is ``None`` the raw bytes value is preserved |
| 1182 | (useful for binary data such as vectors). |
| 1183 | """ |
| 1184 | fields = self.client.hgetall(id) |
| 1185 | fields = { |
| 1186 | str_if_bytes(k): decode_field_value(v, str_if_bytes(k), field_encodings) |
| 1187 | for k, v in fields.items() |
| 1188 | } |
| 1189 | |
| 1190 | try: |
| 1191 | del fields["id"] |
| 1192 | except KeyError: |
| 1193 | pass |
| 1194 | |
| 1195 | return Document(id=id, **fields) |
| 1196 | |
| 1197 | @deprecated_function(version="2.0.0", reason="deprecated since redisearch 2.0") |
| 1198 | def get(self, *ids): |