Product Overview
SanteDB 2.1.161+ on PostgreSQL 10 returns "websearch_to_tsquery" error
Issue: After installing an upgrade for a SanteDB iCDR server to 2.1.161, the service starts however, when attempting to perform a freetext search (with _any) the user receives an error that websearch_to_tsquery is not a function.
Applies To:
  • SanteDB iCDR (Version 2.1.161+) on PostgreSQL 10
Symptoms:
  • When performing a query that uses _any the iCDR returns an error that websearch_to_tsquery is not available
Solutions:
  1. 1.
    Open a SQL command prompt to your PostgreSQL 10 server
  2. 2.
    Re-create the fti_tsquery stored procedure to use a different algorithm:
1
CREATE OR REPLACE FUNCTION websearch_to_tsquery (term_in IN TEXT)
2
RETURNS tsquery
3
IMMUTABLE AS
4
$
5
BEGIN
6
RETURN TO_TSQUERY(ARRAY_TO_STRING(STRING_TO_ARRAY(TERM_IN, ' '), ' & '));
7
END;q
8
$ LANGUAGE plpgsql;
Copied!
Copy link