pg_search trigram扩展无法正常工作

时间:2017-01-25 18:44:05

标签: pg-search trigram

Rails5,我把它安装在数据库

PgSearch.multisearch_options = {
  :using => [:tsearch, :trigram],
}

并在初始化程序中:

<%
Dim conn1, conn2, rs, rssql, insertsql

Set conn1 = Server.Createobject("ADODB.Connection")
Set conn2 = Server.Createobject("ADODB.Connection")

conn1.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\OLA\SITES\SuperCleanerWINHOST\BACK\file.xls;Extended Properties=""Excel 8.0;HDR=NO;IMEX=1"";"

conn2.open "dsn=DSN_supercle_dsn;uid=DB_107185_cleanerdb_user;pwd=XXXXX;"

set rs = Server.CreateObject("ADODB.Recordset")
rssql = "SELECT * FROM ['Website stock$']"
rs.open rssql,conn1,0,1 

Do While Not rs.eof

insertsql = "INSERT into dbo.BACKUPP (KODIKOS, APOTHEMA) values ('" & rs("F1") & "', '" & rs("F2") & "')"

'Response.write insertsql
conn2.execute(insertsql)

rs.movenext
Loop

rs.close
conn1.close
conn2.close

Set rs = Nothing
Set conn1 = Nothing
Set conn2 = Nothing
%>

我只尝试过:trigram(不是:tsearch),即使在db:reset和rake pg_search:multisearch:rebuild [AllModels]之后也无法工作。

我错过了一步吗?

1 个答案:

答案 0 :(得分:0)

我是pg_search的作者。

Trigram搜索需要pg_trgm扩展名。

有关详细信息,请参阅pg_search READMEthe wiki page for Installing PostgreSQL Extensions