How to make an object type searchable?
by Neophytos Demetriou (k2pts\@cytanet.com.cy)
@@ -35,7 +39,8 @@
writing concrete functions that follow the specification. For
example, the implementation of datasource
for the
object type note
, looks like this:
-ad_proc notes__datasource {
+
+ad_proc notes__datasource {
object_id
} {
\@author Neophytos Demetriou
@@ -60,7 +65,8 @@
file which associates the implementation with a contract name. The
implementation of FtsContentProvider
for the object
type note
looks like:
-select acs_sc_impl__new(
+
+select acs_sc_impl__new(
'FtsContentProvider', -- impl_contract_name
'note', -- impl_name
'notes' -- impl_owner_name
@@ -73,7 +79,8 @@
FtsContentProvider
and your concrete functions.
Here's how an association between an operation and a concrete
function looks like:
-select acs_sc_impl_alias__new(
+
+select acs_sc_impl_alias__new(
'FtsContentProvider', -- impl_contract_name
'note', -- impl_name
'datasource', -- impl_operation_name
@@ -93,7 +100,8 @@
We do this by adding triggers on the table that stores the content
items of your object type. Here's how that part looks like for
note
.
-create function notes__itrg ()
+
+create function notes__itrg ()
returns opaque as $$
begin
perform search_observer__enqueue(new.note_id,'INSERT');