I'm learning Sphinx and I now understand how to setup and update indexes. The problem is deleted entries. I plan to use delta indexes but it appears they don't update deleted rows so if a row is deleted in my database that entry can still show in a search on the site until the full index happens; however, a full index will only happen once a day.
So how can I update the index to remove deleted entries? I read about using a kill list but don开发者_如何学Python't understand how I would use it. Do I use it inside the delta index? Are there any config examples with a kill list being used? The manual shows an example but I don't know how it would be used in the config file.
EDIT
Is this the idea? You use sql_query_killlist
in the config to query all ids not to include in the index? So in my code, if someone wanted to delete a story, instead of deleting the row itself I would have a flag that says "deleted" and then use sql_query_killlist
to query all stories with the deleted field set to 1? Then run some type of cron job would delete the rows at a later date?
In your delta indexes you could collect document ids in kill-list. Its only id list in your delta index it wont touch your main index. Instead then you query your indexes as main, delta - the delta index suppresses all documents from main index that ids in kill-list. However documents really removed on merge of main with a delta.
精彩评论