【发布时间】:2012-05-15 01:54:39
【问题描述】:
我让 pg_search 使用多重搜索在我的 Rails 3.2.3 应用程序上工作。然后我在 this post. 中实现了nertzy(pg_search 的作者)提供的初始化程序。现在,当我运行搜索时,我收到以下错误:
PG::Error: ERROR: operator does not exist: text % unknown
LINE 1: ... ((coalesce("pg_search_documents"."content", '')) % 'searchterm...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
我的视图是使用以下代码呈现的:
<%= @pg_search_documents.each do |pg_search_document| %>
<%= pg_search_document.searchable.title %>
<% end %>
我的其余设置可以在 here. 找到任何帮助非常感谢。
【问题讨论】:
-
您找到答案了吗?我遇到了同样的问题。
-
嘿约翰。我想回忆一下,但我想我通过删除三元组功能(不管是什么)解决了这个问题。所以删除这一行:
:trigram => {}为我修复了它。 -
是的,深入挖掘我发现您必须安装 trigram 包才能使其工作。 pg_search 页面上有一些文档。
标签: ruby-on-rails-3 full-text-search pg-search