Forum OpenACS Development: Look for search implementations up the type hierarchy

Has anyone looked at looking up the type hierarchy for search callback implementations?

I did this for one client web site, but it was highly customized. All searchable content was a subtype of a specific subtype of content_revision.

For example, I created a subtype of content_revision called "all_content" and all the interesting objects in the web site derived from all_content.

This makes things simple. One problem with searching up the type hierarchy now is content_revision implementations that rarely make sense.

Is there a benefit to adding this feature to the search package or will it introduce unexpected behavior?

In xowiki, the counterpart of "all_content" is "::xowiki::Page". What do you mean exactly by "searching up the type hierarchy"? Save some definitions in the service contacts for the derived types? Or being able to specify type plus (optionally) subtypes/supertypes in a search query?
Collapse
Posted by Dave Bauer on
The idea would be to check if a callback for a specific object type exists. If it does not exist, look to the supertype for the implementation. This could be used for the datasource or url.

This might be useful for xowiki, since you could create a datasource implementation that used introspection to get the attributes of a subtype of xowiki::Page and generate the search datasource from that. Since the method would be the same you would not have to re-implement it for every substype of xowiki::Page.

Right now content_revision has a generic implementation that is almost always wrong, so we would need to deal with that. Generally generic content_revisions are not interesting objects, if you wanted them to be indexed for search you'd create a subtype.