sheevazz / searchable-behaviour-for-cakephp

Automatically exported from code.google.com/p/searchable-behaviour-for-cakephp
0 stars 0 forks source link

search_index doesn't delete indexed data on instance's deletion #16

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a record that will be indexed with the behaviour.
2. Delete the record.
3. The record is deleted, but the record's indexed data is not.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
Seen on CakePHP version 1.2

Please provide any additional information below.
Adding the following method to search_index.php solves the problem:

function afterDelete(&$model) {
    $conditions = array('model'=>$model->alias,
                        'association_key'=>$model->id);
    $this->SearchIndex->deleteAll($conditions);
}

Original issue reported on code.google.com by mora...@gmail.com on 1 Jun 2009 at 1:58

GoogleCodeExporter commented 9 years ago
good call

Original comment by charless...@gmail.com on 9 Jun 2009 at 3:57

GoogleCodeExporter commented 9 years ago

Original comment by calin....@gmail.com on 10 Jun 2009 at 11:28