Forum OpenACS Q&A: OpenFTS search and Edit-This-Page

Collapse
Posted by Ivan Histand on
Hi...

I'm having a bit of trouble getting the OpenFTS package to return
relevant and correct results with the Edit-This-Page package.  Here's
what the resulting url looks like, given an ETP instance mounted at
/foo and an article named "bar":

/acs-content-repository/foo/bar?revision_id=3721

Two problems with this:

1.  The proper url is /foo/bar?revision_id=3721  The url above
doesn't resolve at all on my system.

2.  I really don't want anything to show up in search results except
the live revision.  In the example above, if there were 4 revisions
all matching the search term I'd get all four.  What I really want is
just one url without the revision_id like this:  /foo/bar

Could anyone suggest the proper place in the code to look to fix this,
or is this by design and I'm missing something else?

Thanks...

Collapse
Posted by Dave Bauer on
These are two seperate issues.
It looks like you are using a default service-contract for the content repository. You will need to write a search service-contract implementation for your ETP content-type.

When you define this contract, you specify a tcl proc to deliver the text of the content to be indexed, and another tcl proc to deliver the url of the item.

The second issue is the indexing of all revisions in the CR. I have tested two different approaches to solving this. The first, alters the search triggers to only index live_revisions. This would not require any changes to the applications.

The second adds a new field, searchable_p to the cr_revisions table and modified the search triggers for the CR to check for searchable_p = TRUE before adding or removing items from the index. To use this method, you would need to modify ETP to update the searchable_p flag.
I have submitted a patch for this second method here: https://openacs.org/sdm/one-patch.tcl?patch_id=289

The indexing of all content_revisions obviously affects all the packages that use the content repository.