Forum OpenACS Development: Adding full text search to XoWIKI extensions

I have an application where I added a new type of subtype XoWIKI Page, which adds additional attributes to the ones normally offered by XoWIKI.

My question is, how do I enable the indexing of these additional attributes / columns so the search package is able to find a term in them and display a match?

Collapse
Posted by Dave Bauer on
I don't know if xowiki provides anything special for search. Its simple enough to write your own callback (5.3) or service contract implementation for your new subtype of content_revision.

I wrote some code in edit-this-page ages ago that would generate simple implementations on the fly. You could easily write a implementation that automatically concatenated all the attributes together with the content and indexed that automatically.

It might be useful to have search types inherit, but now you can avoid your type being indexed by not implementing search on the type.

Collapse
Posted by Gustaf Neumann on

XoWiki does not do anything special in this regard. Adding a service contract for the type like the following should be sufficient. One can reuse the datasouce and url implementations from xowiki, if nothing special is needed. xowiki uses the output of the method "render" for indexing, which can be overloaded in the derived types.

    acs_sc::impl::new_from_spec -spec {
      name "::xowiki::Page"
      aliases {
        datasource ::xowiki::datasource
        url ::xowiki::url
      }
      contract_name FtsContentProvider
      owner xowiki
    }

It would be possible to include a flag in the type definition (xowiki class) to state whether the type should be included for indexing. If the flag is set, it could issue the above sc automatically. However, i am not sure whether this is needed.

Items with publish_status "production" are not indexed.