Forum OpenACS Q&A: Re: FtsContentProvider, missing bindings on oracle

Where can I read up on these two interfaces? Big picture of search?

Package search has only one piece of documentation, Neophytos' "How to make an object type searchable" (https://openacs.org/doc/search/guidelines.html). It seems to imply that every site has to implement those procedures for every package (or object type) they want to make searchable. This sounds like much repeated work. Please tell me I'm reading this wrong! Dave's post saying "callback interfaces have been added to most packages" makes me hopeful.

Thanks
/Christian

Collapse
Posted by Neophytos Demetriou on
The search package exposes an interface (service contract) that enables you to make any object type searchable (as long as you implement the given interface, in our case FtsContentProvider). You do not have to do this for every site, yet you can choose which bindings to enable/activate which means that for site A you may opt for indexing/searching object types X1, X2, X3, and so on where as for site B you may opt for object type X2 and X5.

The search package also exposes a service contract for search engines, namely FtsSearchEngineDriver. There are currently three (AFAIK) implementations of this contract. The two are for postgresql, namely openfts-driver and tsearch2-driver. The third is for oracle, namely intermedia-driver.

I have not tried the oracle one but the other two search engine "drivers" (openfts and tsearch2) work as advertised.

Thanks Neophytos!
(Of course I was interested in the callback interface, which was advertised as easier to use than the service contract.)

From what you write, and from the package names, I would have assumed you'd need the "search" package and one of the three implementations of the FtsSearchEngineDriver interface. Running on Orace, that would be package "intermedia-driver".

Now what's the relationship between packages "search", "intermedia-driver" and "site-wide-search"? Because something is weird here.

The packages "search" and "intermedia-driver" overlap. There's considerable code duplication, and I doubt they can coexist. E.g., both have sql/oracle/search-packages-create, which create package search_observer with two procedures, enqueue and dequeue. Sure there are differences -- one has acs_objects.object_id%TYPE and the other search_observer_queue.event%TYPE. But those are just two long-winded notations for INTEGER. The signatures look identical to me.

A normal package names its tables etc. to hint at the package. But "search" and "intermedia-driver" use the prefix "sws_", hinting at "site-wide-search".

It seems that "search" replaces "site-wide-search", which should no longer be used. But is "intermedia-driver" a complete replacement for "search"?

BTW, installing intermedia-driver does NOT create an appropriate SC impl, and hence there cannot be a binding to contract FtsEngineDriver.

Collapse
Posted by Neophytos Demetriou on
From what you write, and from the package names, I would have assumed you'd need the "search" package and one of the three implementations of the FtsSearchEngineDriver interface. Running on Orace, that would be package "intermedia-driver".
This is correct.

It seems that "search" replaces "site-wide-search", which should no longer be used. But is "intermedia-driver" a complete replacement for "search"?
site-wide-search is an older package and intermedia-driver is supposed to be a "complete" replacement. intermedia-driver is also an implementation of the FtsEngineDriver provided by the "search" package.
BTW, installing intermedia-driver does NOT create an appropriate SC impl, and hence there cannot be a binding to contract FtsEngineDriver.
Well, it should. The service contracts are supposed to be defined within intermedia-driver/sql/oracle/search-sc-create.sql. As I said before, I haven't used the intermedia-driver so I don't know the details about the specialized enqueue/dequeue functions within the driver. My understanding/impression though is that it was done that way in order to use oracle intermedia features.
The last statement holds true: intermedia-driver/sql/oracle/search-sc-create.sql does define service contracts. Except for an "exit;" at the end, it's identical to search/sql/oracle/search-sc-create.sql. But that doesn't make sense.

If intermedia-driver was an implementation of the FtsSearchEngineDriver contract, it should create an impl, not redefine the contract.

Package "intermedia-driver" almost looks like a replacement for "search" -- except it lacks the UI. (I tried mounting it, but www only contains an empty doc directory.)