Jump to:

23553 Posts in 19380 Topics by 2892 members

General Questions

SilverStripe Forums » General Questions » SS 2.4 rc1 PostgreSQL and searchEngine

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 938 Views
  • nomen
    Community Member
    52 Posts

    SS 2.4 rc1 PostgreSQL and searchEngine Link to this post

    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?

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.