I removed records from a table using a Mysql Editor.
This table was previously indexed by Sphinx
(using indexer --rotate
).
When I re-rotate again using indexer --rotate
the old record can still be queried.
To test whether the index is actually being obeyed I
- Added a new record
- Modified an old one
I re-rotated and the new/modified records were as expected yet the deleted record was still being found during a SphinxQL query.
Lastly, I added a Where
condition to the indexing so it would only index those records where Add=1
.
I then added back the old record with its original ID and and set Add=0
.
NOW the record is not found during SphinxQL query.
I've read various solutions in the interim such as having a secondary 'Deleted Records' table the index can query yet this seems like a difficult and error-prone solution.
Isn't there a simpler way to have Sphinx simply re-create the index with only the existing records?
Since I do a daily rotation would deleting the index and then rotating it work? I'd test it but since Sphinx is so finicky would prefer to ask before breaking anything.