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

Collapse
Posted by Emmanuelle Raffenne on
Jorge,

I assume you installed from the 2.3.0 tarball. In this case, to upgrade from the repository:

- cd to your packages/ directory (/var/lib/aolserver/service0/packages?)
- remove file-storage/ and search/ directories
- from your packages/ directory, type:

cvs -d :pserver:mailto:anonymous@cvs.openacs.org:/cvsroot co -r oacs-5-3 search
cvs -d :pserver:mailto:anonymous@cvs.openacs.org:/cvsroot co -r oacs-5-3 file-storage
- restart your server

Collapse
Posted by Jorge Couchet on
Emmanuelle,

Excellent! Your instruction worked very well!!. Thanks a lot!

Only remains a problem:
I have searched the word "Estrategia" that is in the Forum and Faq, and the search brought me what is in Forum, but not that is in FAQ. It would seem to be that the Search Package isn't indexing the FAQ's content. Is there any extra trick in order to have the FAQ's content indexed?.

Cheers

Jorge.

Collapse
Posted by Jorge Couchet on
Well, I have inserted in the search_observer_queue the FAQ:

***************
insert into search_observer_queue ( select entry_id, current_timestamp, 'INSERT' from faq_q_and_as );
***************

And now the content of the FAQ is indexed. But if I put a new question with the word "estrategia" in the FAQ, the new question didn't appear in the search. It would seem to be that is failing the automatic indexing. Any clue for this?.

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!!!