Forum .LRN Q&A: Bug in search with postgres

Hello!

Every time we get an error message in the log. See below.
We think of there are a oracle function ctx_dll.sync_index in the general code (search/tcl/search-procs.tcl). That function not exists in Postgres. How could replace that
function for a postgres right function?

db_exec_plsql optimize_intermedia_index {begin
ctx_ddl.sync_index ('swi_index');
end;
}

Regards,
Agustin

-------------------------------------------
[19/jul/2007:19:25:08][20312.1088297328][-sched:26-] Error: dbinit: error(pizarradb.uv.es:5437:openacsdb_5_3_07_08,ERROR: syntax error at or near
"ctx_ddl" at character 1
QUERY: ctx_ddl.sync_index ('swi_index')
CONTEXT: SQL statement in PL/PgSQL function "__exec_3885_optimize_intermedia_index" near line 2
): 'create function __exec_3885_optimize_intermedia_index () returns varchar as '
begin
ctx_ddl.sync_index (''swi_index'');
end;

' language 'plpgsql''

Collapse
Posted by Don Baccus on
OpenACS 5.3.0's search initialization script always scheduled the Oracle indexer regardless of database, which was a bug.

OpenACS 5.3.2 (which has just been built) fixes that bug.

If you don't want to update, just go to

search/tcl/search-init.tcl

and delete the call which schedules the tcl proc which calls the Oracle Ctx* proc, and restart your server.

Collapse
Posted by Jose Agustin Lopez Bueno on
Ok,

but I am seeing the code and I think of that that code is running, both Postgres and Oracle:

ad_proc -private search::indexer {} {
Search indexer loops over the existing entries in the search_observer_queue
table and calls the appropriate driver functions to index, update, or
delete the entry.

@author Neophytos Demetriou
@author Jeff Davis (mailto:davis@xarg.net)
} {

set driver [ad_parameter -package_id [apm_package_id_from_key search] FtsEngineDriver]

if { $driver eq ""
|| (![callback::impl_exists -callback search::index -impl $driver] && ! [acs_sc_binding_exists_p FtsEngineDriver $driver])} {
# Nothing to do if no driver
ns_log Debug "search::indexer: driver=$driver binding exists? [acs_sc_binding_exists_p FtsEngineDriver $driver]"
return
}
# JCD: pull out the rows all at once so we release the handle
foreach row [db_list_of_lists search_observer_queue_entry {}] {
nsv_incr search_static_variables item_counter
if {[nsv_get search_static_variables item_counter] > 1000} {
nsv_set search_static_variables item_counter 0
db_exec_plsql optimize_intermedia_index {begin
ctx_ddl.sync_index ('swi_index');
end;
}
}
...

Collapse
Posted by Don Baccus on
Oops, yes, you're right.

I've committed a fix for this to cvs HEAD, changing

search/tcl/search-init.tcl
search/tcl/search-procs.tcl

Please take these and try them and see if they fix this problem.

Collapse
Posted by Jose Agustin Lopez Bueno on
Thanks, Don!

I think of the bug is resolved with your code.

Regards,
Agustin