Forum OpenACS Development: Search: only root forums messages are indexed
I'm testing the search package on my local site and noticed that only root messages content are indexed. The forums_message_search__itrg enqueue an insert if the new message is a root one, an update on the root message otherwise. Since when performing the update it's the ID of the root message which is passed to retrieve and index the content, the entry of the root message is updated each time a new message is added to the thread.
I've fixed this on my local site to index every message, not only the root ones. I've written also an upgrade script to update the triggers and to enqueue previous non-indexed messages.
I don't know if there's a good reason to index only root messages (I can't think of any), if there isn't, I'll commit to oacs-5-3 branch.
You want to send someone to the thread where the message is located. You also don't want to have 100 of the same thread returned in the results. One result for a relevant thread is better.
The code is SUPPOSED to index the root and all the child messages.
This is quite apparent if you have a forum with long threads such as openacs.org.
I had a closer look and I think the problem is in the search::datasource implementation. The combined content of all messages of the thread should be indexed but the query to retrieve it is not correct:
select subject, content, format
-- lets just get the message instead of the whole thread
-- replace with a connect by
Thanks Dave. I'll fix that and try again.
Use the old query from the service contact
It looks like when search was added for Oracle the technique was changed to query for the forums messages.