Forum OpenACS Q&A: Re: How do you tell OpenFTS to index existing ETP content?

Ok, here's the (current) problem.

I'm using the code Dave posted above to add the existing content to the queue to be indexed:

insert into search_observer_queue (select item_id, current_timestamp, 'INSERT' from cr_items where content_type='etp_page_revision');

The proc that does the sweep through this table takes each item and calls [acs_object_type $object_id], where object_id is the item_id inserted above.  Unfortunately, the object type being returned is not etp_page_revision, it's content_item, and there's no binding for that.

So is there something else wrong here, or do I just need to create a proc to index things of type content_item?

Also, I don't have the proc Malte referred to above and I don't see where it would get created.  I do have etp::search::etp_page_revision, and I do have the FtsContentProvider binding for etp_page_revision, which I would have expected to create the datasource proc but it's not there, even after a restart.

Okay, I had this problem as well. I solved it by turning on the debugging of Service Contract, unbinding all Fts* Service Contracts, and then install them again. *restart*.

If you don't have the proc mentioned above, FTS won't be able to index your content, as it does not know how to get the content out of ETP (datasource...).

As for the search_observer_queue. Good question, but I assume you are fine with creating a proc to index the content_item instead. But don't ask me for details ...

OTOH, I would first try out, if you can get a new item registered and debug how this happens. Once you get newly published items to show up on the search, try the insert again, as you might have to select revision_id instead of item_id, but I might be utterly mistaken (shooting out of my gut here).

Janine wrote:
The proc that does the sweep through this table takes each item and calls [acs_object_type $object_id], where object_id is the item_id inserted above. Unfortunately, the object type being returned is not etp_page_revision, it's content_item, and there's no binding for that.
I think that the stuff that goes into the search_observer_queue should be content_revisions (or subtypes of content_revision), not content_items. So, I would try the query:

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;