Forum OpenACS Development: Search: only root forums messages are indexed

Request notifications

Hi,

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.

Collapse
Posted by Dave Bauer on
There is a good reason.

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.

Collapse
Posted by Emmanuelle Raffenne on
I agree that having only one result for a thread is better.

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:

<fullquery name="callback::search::datasource::impl::forums_message.messages">
<querytext>
select subject, content, format
from forums_messages
where message_id=:message_id
-- lets just get the message instead of the whole thread
-- replace with a connect by
</querytext>
</fullquery>

Thanks Dave. I'll fix that and try again.

Collapse
Posted by Dave Bauer on
Aha.
Use the old query from the service contact

http://cvs.openacs.org/cvs/openacs-4/packages/forums/tcl/forums-sc-procs-postgresql.xql?rev=1.1.1.1&view=markup

It looks like when search was added for Oracle the technique was changed to query for the forums messages.

Collapse
Posted by Emmanuelle Raffenne on
I've fixed the queries and committed to oacs-5-3 branch.