我有一个Sphinx RT-index,可用于搜索文档。但是,当我删除其中一个文档时,索引大小并没有减小。
例如,当我尚未删除文件时,它向我显示:
+-------------------+-----------+
| Variable_name | Value |
+-------------------+-----------+
| index_type | rt |
| indexed_documents | 220 |
| indexed_bytes | 191179984 |
| ram_bytes | 11436853 |
| disk_bytes | 10887857 |
| ram_chunk | 8570627 |
| disk_chunks | 1 |
| mem_limit | 134217728 |
+-------------------+-----------+
8 rows in set (0.00 sec)
但是,一旦删除一个文件,它就会向我显示以下概述:
+-------------------+-----------+
| Variable_name | Value |
+-------------------+-----------+
| index_type | rt |
| indexed_documents | 219 |
| indexed_bytes | 191179984 |
| ram_bytes | 11436853 |
| disk_bytes | 10887857 |
| ram_chunk | 8570627 |
| disk_chunks | 1 |
| mem_limit | 134217728 |
+-------------------+-----------+
8 rows in set (0.00 sec)
请注意,indexed_documents
中的数字减少了1。虽然,索引的大小没有改变...这怎么可能。即使在语句OPTIMIZE INDEX
之后,索引大小仍保持不变...
如何确保也删除了实际删除的文档的数据,从而减小了索引的大小?