Forum OpenACS Q&A: BBoard, cr_repository, SWS

Collapse
Posted by Allan McKinnon on
Hello:

Problem with bboard and site-wide-search in Oracle 8.1.7 Solaris 8

I've been trying to get bboard to work under SWS. The search results always return two hits per bboard message. One with the title, which points to the correct message, and another with the title[forum name] which points nowhere. Tracking this back I see that cr_revisions and cr_items also have both of these entries for each message. This is the reason that double hits appear in SWS AFAIK.

I've been all over the code/docs with my limited abilities but cannot seem to find why each bboard message should generate double entries in the content repository.

Anyone have any thoughts on how I should attempt debugging this?

thx
allan

Collapse
Posted by Stephen . on
Bboard postings are inserted a second time with a modified title more suitable for sending in email reminders. Yes, that's funky.
Collapse
Posted by Don Baccus on
Funky is far too polite a word for it.  I didn't realize that it was breaking sitewide search but it makes sense that it would.  The search package assumes everything in the CR is searchable, which is a flawed assumption.

Hmmm...if anyone has time to look into a solution for this at the search package level e-mail me.  I won't hold up the beta release for this issue but it would be nice to fix before final release if possible.

Collapse
Posted by Peter Vessenes on
Okay, we just seem to have fixed this. Here's what needs to be done.
  • First, fix all your old messages. This update will work, provided you don't use acs_messages for anything other than bboards.
    update acs_contents 
    set searchable_p = 'f' 
    where content_id in 
       (select content_id from acs_contents, 
        bboard_forum_message_map, 
        cr_items, 
        acs_objects o 
        where content_id = live_revision 
          and item_id    = message_id(+) 
          and message_id is null 
          and o.object_id = item_id 
          and o.object_type = 'acs_message');
    
  • Second, update the following two scripts:
    1. tcl/bboard-procs.tcl, in the bboard_alert_one_msg proc. Add this query after the e-mail message is created.
              db_dml message_non_searchable {
      	update acs_contents set searchable_p = 'f'
      	where content_id = (select live_revision from cr_items where item_id = :email_mesg_id)
          }
      
    2. www/message-mail-2.tcl, in the db_transaction. Add this query after the new message is created.
          # set this puppy to not searchable
          db_dml message_non_searchable {
      	update acs_contents set searchable_p = 'f'
      	where content_id = (select live_revision from cr_items where item_id = :message_id)
          }
      
I couldn't tell if the message-mail scripts are used in the default distribution (they let a user mail a post to someone), but for completeness, we added that query. #2 hasn't been tested. #1 is running just fine right now on Oracle 9i/Linux. I gotta agree with Don, this is a terrible kludge.