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

Collapse
Posted by Jorge Couchet on
Reading the document that states how to make an object searchable (in OpenACS documentation) appears the following:

**********
"if your object type uses the content repository to store its items, then you are done. If not, an extra step is required to inform the search_observer_queue of new content items, updates or deletions. We do this by adding triggers on the table that stores the content items of your object type"
**********

Isn't the FAQ package using the Content Repository and is necessary to add manually to the FAQ table the triggers to inform the search_observer_queue?.

Collapse
Posted by Emmanuelle Raffenne on
Jorge,

I don't think FAQ is using the content repository. The triggers to fill up the search_observer_queue table are missing in the FAQ package, that's why the content is not indexed.

Collapse
Posted by Jorge Couchet on
Emmanuelle,

Thanks a lot!! I'm adding the triggers to the FAQ 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!!!