Drop the index if it exists. Replaced `drop_index` in RediSearch 2.0. Default behavior was changed to not delete the indexed documents. ### Parameters: - **delete_documents**: If `True`, all documents will be deleted. For more information see `FT.D
(self, delete_documents: bool = False)
| 991 | return self.execute_command(*args) |
| 992 | |
| 993 | def dropindex(self, delete_documents: bool = False): |
| 994 | """ |
| 995 | Drop the index if it exists. |
| 996 | Replaced `drop_index` in RediSearch 2.0. |
| 997 | Default behavior was changed to not delete the indexed documents. |
| 998 | |
| 999 | ### Parameters: |
| 1000 | |
| 1001 | - **delete_documents**: If `True`, all documents will be deleted. |
| 1002 | |
| 1003 | For more information see `FT.DROPINDEX <https://redis.io/commands/ft.dropindex>`_. |
| 1004 | """ # noqa |
| 1005 | args = [DROPINDEX_CMD, self.index_name] |
| 1006 | |
| 1007 | delete_str = ( |
| 1008 | "DD" |
| 1009 | if isinstance(delete_documents, bool) and delete_documents is True |
| 1010 | else "" |
| 1011 | ) |
| 1012 | |
| 1013 | if delete_str: |
| 1014 | args.append(delete_str) |
| 1015 | |
| 1016 | return self.execute_command(*args) |
| 1017 | |
| 1018 | def _add_document( |
| 1019 | self, |
nothing calls this directly