Forum OpenACS Q&A: Re: Reindexing Search?

Collapse
2: Re: Reindexing Search? (response to 1)
Posted by Claudio Pasolini on
You have to rebuild the search_observer_queue table with pointers to your contents. I once used the following queries (I don't remember who posted them on the forum).

To reindex edit-this-page contents:

   insert into search_observer_queue (
       select revision_id, current_timestamp, 'INSERT'
       from cr_revisions r, cr_items i
       where r.item_id = i.item_id and
             i.content_type = 'etp_page_revision' and
             r.revision_id = i.live_revision);
To reindex file-storage contents:
 insert into search_observer_queue (
       select revision_id, current_timestamp, 'INSERT'
   from cr_revisions r, cr_items i
   where r.item_id = i.item_id and
         i.content_type = 'file_storage_object' and
         r.revision_id = i.live_revision and
         (mime_type = 'application/pdf' or
          mime_type = 'application/msword' or
          mime_type = 'application/vnd.ms-word' or
          mime_type = 'application/excel' or
          mime_type = 'application/vnd.ms-excel' or
          mime_type like 'text/%'));
To reindex news contents:
   insert into search_observer_queue (
       select revision_id, current_timestamp, 'INSERT'
       from cr_revisions r, cr_items i
       where r.item_id = i.item_id and
             i.content_type = 'news' and
             r.revision_id = i.live_revision);
Hope this helps.