Hi all:
I need to put search engine working in my SS 2.4 with PostgreSQL.
In the file PostgreSQLDatabase.php, function searchEngine , the query
$result=DB::query("SELECT table_name, column_name, data_type FROM information_schema.columns WHERE data_type='tsvector' AND table_name in ('" . implode("', '", $classesToSearch) . "');");
needs to be changed to:
$result=DB::query("SELECT \"table_name\", \"column_name\", \"data_type\" FROM \"information_schema\".\"columns\" WHERE \"data_type\"='tsvector' AND \"table_name\" in ('" . implode("', '", $classesToSearch) . "');");
to work correctly.
Now, the SQL gives no error, but is empty, so the line
if (!$result->numRecords()) throw Exception('there are no full text columns to search');
is executed.
I have execute the query to see all date_type values and does not exist in any table with "tsvector" date_type.
I change the query to:
$result=DB::query("SELECT \"table_name\", \"column_name\", \"data_type\" FROM \"information_schema\".\"columns\" WHERE \"data_type\"='text' AND \"table_name\" in ('" . implode("', '", $classesToSearch) . "');");
but now I´m having new error function ts_rank(text, tsquery) does not exist".
What I´m doing bad? Is the searcEngine tested with PostgreSQL?