I got around this problem by using a trigger on the table I index that records the values of deleted items in a queue table so when my next Solr update rolls around it sends a remove request for that record's ID. Once the Solr deletion is done, I remove that ID from the queue table. Of course, you have to be on MySQL 5.0 or above to have that available to you. Otherwise, you'll have to manually add something to your deletion queries to record all the IDs you're about to delete to a queue table.

Ryan T. Grange, IT Manager
DollarDays International, Inc.

Tushar_Gandhi wrote:
Hi,
   I am using solr 1.3. I am facing a problem to delete the index.
I have mysql database. Some of the data from database is deleted, but the
indexing for those records is still present. Due to that I am getting those
records in search result. I don't want this type of behavior. I want to
delete those indexes which are not present in database. Also, I don't know
which records are deleted from database and present in index. Is there any
way to solve this problem? Also I think that re indexing will not solve my
problem, because it will re index only the records which are present in
database and don't bother about the indexes which don't have reference in
database.

Can anyone have solution for this?

Thanks,
Tushar

Reply via email to