Forum OpenACS Q&A: Problem installing OpenFTS 0.3.2 with OpenACS-4-6

Having a problem with installing OpenFTS 0.3.2 following the new instructions. Have successfully installed 0.2 several times before so baffled. nsfts.so is successfully compiled and loaded according to the aolserver log.


Getting an error message on initialisation :

Request Error
Database operation "dml" failed
    while executing
"error "$err""
    invoked from within
"if [catch {
    db_dml create_table "create table $table_name ( ${table_id} int not null primary key, path varchar unique, fts_index txtidx, last_modi..."
    ("uplevel" body line 21)
    invoked from within
"uplevel {
    	  ad_page_contract {

    Initialize OpenFTS

    @author Neophytos Demetriou

} {
    table_name
    table_id
    dict
    numbergroup..."
    (procedure "code::tcl::/web/nickevertontrust/packages/openfts-driver/www..." line 2)
    invoked from within
"code::tcl::$__adp_stub"
    invoked from within
"if { [file exists $__adp_stub.tcl] } {

      # ensure that data source preparation procedure exists and is up-to-date
      adp_init tcl $__adp_stub
..."
    ("uplevel" body line 3)
    invoked from within
"uplevel {

    if { [file exists $__adp_stub.tcl] } {

      # ensure that data source preparation procedure exists and is up-to-date
      adp_init t..."
    (procedure "adp_prepare" line 2)
    invoked from within
"adp_prepare "
    (procedure "template::adp_parse" line 30)
    invoked from within
"template::adp_parse [file root [ad_conn file]] {}"
    (procedure "adp_parse_ad_conn_file" line 7)
    invoked from within
"$handler"
    ("uplevel" body line 2)
    invoked from within
"uplevel $code"
    invoked from within
"ad_try {
	$handler
      } ad_script_abort val {
	# do nothing
      }"
    invoked from within
"rp_serve_concrete_file [ad_conn file]"
    (procedure "rp_serve_abstract_file" line 60)
    invoked from within
"rp_serve_abstract_file "$root/$path""
    ("uplevel" body line 2)
    invoked from within
"uplevel $code"
    invoked from within
"ad_try {
	rp_serve_abstract_file "$root/$path"
	set tcl_url2file([ad_conn url]) [ad_conn file]
	set tcl_url2path_info([ad_conn url]) [ad_conn path_inf..."

I get a problem when trying to follow the following instructions :

The path shown in the instructions to: /usr/local/postgresql-7.2.3/contrib/pgsql_contrib_openfts$ make install
should I belive say: /usr/local/src/postgresql-7.2.3/contrib/pgsql_contrib_openfts$ make install

Also the file tsearch.sql is not in /usr/local/src/postgresql-7.2.3/contrib/tsearch/tsearch.sql
but rather in /usr/local/src/postgresql-7.2.3/contrib/tsearch/sql/tsearch.sql

When I run the command to pass tsearch.sql to psql I get the following error (edited highlights(!), cannot post all of it because of illegal tags):

[postgres@ws01 pgsql_contrib_openfts]$ /usr/local/pgsql/bin/psql nickevertontrust -f /usr/local/src/postgresql-7.2.3/contrib/tsearch/sql/tsearch.sql
Password: 
psql:/usr/local/src/postgresql-7.2.3/contrib/tsearch/sql/tsearch.sql:6: tsearch.sql: No such file or directory
--txtidx

select '1'::txtidx;
psql:/usr/local/src/postgresql-7.2.3/contrib/tsearch/sql/tsearch.sql:10: ERROR:  Unable to locate type name 'txtidx' in catalog

select '1'::query_txt;
psql:/usr/local/src/postgresql-7.2.3/contrib/tsearch/sql/tsearch.sql:22: ERROR:  Unable to locate type name 'query_txt' in catalog

select '1'::mquery_txt;
psql:/usr/local/src/postgresql-7.2.3/contrib/tsearch/sql/tsearch.sql:61: ERROR:  Unable to locate type name 'mquery_txt' in catalog

CREATE TABLE test_txtidx( t text, a txtidx );
psql:/usr/local/src/postgresql-7.2.3/contrib/tsearch/sql/tsearch.sql:102: ERROR:  Unable to locate type name 'txtidx' in catalog
\copy test_txtidx from 'data/test_tsearch.data'
psql:/usr/local/src/postgresql-7.2.3/contrib/tsearch/sql/tsearch.sql:104: data/test_tsearch.data: No such file or directory
SELECT count(*) FROM test_txtidx WHERE a @@ 'wr|qh';
psql:/usr/local/src/postgresql-7.2.3/contrib/tsearch/sql/tsearch.sql:106: ERROR:  Relation "test_txtidx" does not exist

psql:/usr/local/src/postgresql-7.2.3/contrib/tsearch/sql/tsearch.sql:138: ERROR:  Function 'txt2txtidx(unknown)' does not exist
        Unable to identify a function that satisfies the given argument types
        You may need to add explicit typecasts
select txtidxsize(txt2txtidx('345 qw'));
psql:/usr/local/src/postgresql-7.2.3/contrib/tsearch/sql/tsearch.sql:140: ERROR:  Function 'txt2txtidx(unknown)' does not exist
        Unable to identify a function that satisfies the given argument types
        You may need to add explicit typecasts

insert into test_txtidx (a) values ('345 qwerty');
psql:/usr/local/src/postgresql-7.2.3/contrib/tsearch/sql/tsearch.sql:146: ERROR:  Relation "test_txtidx" does not exist
create trigger txtidxupdate before update or insert on test_txtidx
for each row execute procedure tsearch(a, t);
psql:/usr/local/src/postgresql-7.2.3/contrib/tsearch/sql/tsearch.sql:149: ERROR:  Relation "test_txtidx" does not exist
insert into test_txtidx (t) values ('345 qwerty');


Please can anyone make some sense of this and let me know what I am doing wrong.


Many Thanks
Richard

Collapse
Posted by Richard Hamilton on
I must stop replying to my own messages!!
Sorry to waste everyone's time - maybe this will help others switching from OpenFTS 0.2 when Postgres is already compiled.
Having referred back to the Postgres installation instructions I realised that the new version of OpenFTS requires tsearch to be compiled. The reason that the file tsearch.sql was not where is should be in the instructions is because I had not compiled and installed the tsearch source.
Once I had sorted this OpenFTS installed without problem.
One thing to note with the instructions is that the bit that tells you where to make install should I think say: /usr/local/src/postgresql-7.2.3/contrib/pgsql_contrib_openfts$ make install
Regards

Richard

Collapse
Posted by Vinod Kurup on
One thing to note with the instructions is that the bit that tells you where to make install should I think say: /usr/local/src/postgresql-7.2.3/contrib/pgsql_contrib_openfts$ make install

Thanks, I'll fix that on the 4.6 branch.