Forum: Ferret AAF index updated when record is deleted?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
86a01abd9d77ebfc577b2890623c6170?d=identicon&s=25 Izit Izit (izit)
on 2007-07-27 14:18
Got it all running nicely now for a few days but noticed something
funny. I have a table were lots of records get added, deleted every day.
I can see the added records being added by AAF to the index but I
notices some "ghost" results when doing searches. The search returns
record ID-s that do not exist anymore because they were deleted.

Does AAF also remove entries from the index when records are deleted in
the model ?

regards
36feb4959db6ab8259a44962f0fa761f?d=identicon&s=25 Jens Kraemer (Guest)
on 2007-07-27 21:54
(Received via mailing list)
On Fri, Jul 27, 2007 at 02:18:18PM +0200, Izit Izit wrote:
> Got it all running nicely now for a few days but noticed something
> funny. I have a table were lots of records get added, deleted every day.
> I can see the added records being added by AAF to the index but I
> notices some "ghost" results when doing searches. The search returns
> record ID-s that do not exist anymore because they were deleted.
>
> Does AAF also remove entries from the index when records are deleted in
> the model ?

That depends :-)
If you call record.destroy, aaf will notice, if you use record.delete,
it won't (as
no callbacks are called in this case).

cheers,
Jens


--
Jens Krämer
http://www.jkraemer.net/ - Blog
http://www.omdb.org/     - The new free film database
86a01abd9d77ebfc577b2890623c6170?d=identicon&s=25 Izit Izit (izit)
on 2007-07-28 09:20
Oh silly silly me :-) I had a delete_all in stead of destroy_all. All is
fine now.

thanks

Jens Kraemer wrote:
> On Fri, Jul 27, 2007 at 02:18:18PM +0200, Izit Izit wrote:
>> Got it all running nicely now for a few days but noticed something
>> funny. I have a table were lots of records get added, deleted every day.
>> I can see the added records being added by AAF to the index but I
>> notices some "ghost" results when doing searches. The search returns
>> record ID-s that do not exist anymore because they were deleted.
>>
>> Does AAF also remove entries from the index when records are deleted in
>> the model ?
>
> That depends :-)
> If you call record.destroy, aaf will notice, if you use record.delete,
> it won't (as
> no callbacks are called in this case).
>
> cheers,
> Jens
>
>
> --
> Jens Kr�mer
> http://www.jkraemer.net/ - Blog
> http://www.omdb.org/     - The new free film database
This topic is locked and can not be replied to.