Forum OpenACS Q&A: Is there an easy way to trigger tsearch2 to re-index all content?

I uploaded 250 images to the CR using xowiki to use as test data for the carousel work I have been doing. The images originally had filenames that included a trailing 5 letter code. After uploading the images I edited the images to removed the five letter code from the filename and title fields.

When I do a site-wide-search for the bare filename, the link that tsearch2 returns is the original filename complete with 5 letter code, however the link points to the new url without the 5 letter code.

Is there a convenient way to purge the old filename for all 250 xowiki entered image objects, so that the link that tsearch2 returns to the content item can be changed to match the updated content?

Regards
Richard

insert into search_observer_queue select object_id,'UPDATE',now() from txt;
That's weird, if you edited the item it should reindex it anyway.

So just insert the object_ids of the relevant entries by restricting the query you use to insert, for example using latest_revision from cr_items for the content type that matches xowiki files or parent_id of the xowiki folder.

Dave, thanks very much for the reply.

So if I use the object_id of an xowiki folder then it will re-index all the child objects too?

Is that driven by context_id, such that if I simply use the package_id for the xowiki instance it would re-index all the xowiki instance content?

Regards
Richard

Not quite. You need to insert the object_id of every object you want to index, but since a xowiki folder is flat, you can just select all live_revisions for items with the folder as the parent_id.
xowiki has a web-callable method .../xowiki/?reindex=1 for reindexing all content of an xowiki instance. Note, that it only indexes entries in the ready publish_status. I have just committed an update to handle folder structures as well.
Fantastic, thank you Gustaf. I will collect the update and try it.

Regards
Richard