Forum OpenACS Q&A: Re: Problem and a doubt with the Search package.

Collapse
Posted by Jorge Couchet on
Ready! The content of the FAQ Package is now indexed automatically. For that I have added the following in the database:

******************

create function faq_sc__itrg ()
returns opaque as '
begin
perform search_observer__enqueue(new.entry_id,''INSERT''); return new;
end; ' language 'plpgsql';

create function faq_sc__dtrg ()
returns opaque as '
begin
perform search_observer__enqueue(old.entry_id,''DELETE''); return old;
end; ' language 'plpgsql';

create function faq_sc__utrg ()
returns opaque as '
begin
perform search_observer__enqueue(old.entry_id,''UPDATE''); return old;
end; ' language 'plpgsql';

create trigger faq_sc__itrg after insert on faq_q_and_as for each row execute procedure faq_sc__itrg ();

create trigger faq_sc__dtrg after delete on faq_q_and_as for each row execute procedure faq_sc__dtrg ();

create trigger faq_sc__utrg after update on faq_q_and_as for each row execute procedure faq_sc__utrg ();

******************

Thanks a lot for the help!

Jorge.

Collapse
Posted by Emmanuelle Raffenne on
Thanks Jorge. I've added the triggers to the repository at the oacs-5-3 branch.
Emmanuelle, you are welcome!!!