[英]Ferret search not working for my rails app
First, I logged into the ruby script/console -e production
and tried to index each table using 首先,我登录到ruby script/console -e production
并尝试使用
Model.rebuild_index
It worked fine and returned true
它工作正常并返回true
I then started the ferret server using the command 然后,我使用命令启动了雪貂服务器
ruby script/ferret_server start -e production
Then i started my application and it's all working fine except the search. 然后我启动了我的应用程序,除了搜索之外,其他所有功能都正常运行。 When i try searching on the search tab, i get an error as follows : 当我尝试在“搜索”选项卡上进行搜索时,出现如下错误:
Words::BadWordnetDataset in HomeController#search
Failed to locate the wordnet database. Please ensure it is installed and that
if it resides at a custom path that path is given as an argument when
constructing the Words object.
The search is working fine in the console 在控制台中搜索正常
result = ActsAsFerret.find("admin",[User], :limit => 2)
does fetch me results result = ActsAsFerret.find("admin",[User], :limit => 2)
确实获取了我的结果
Installed the copy of the wordnet data files for OS using : 使用以下命令为操作系统安装了wordnet数据文件的副本:
sudo apt-get install wordnet-base
Word is actually derived from Wordnet : Word实际上是从Wordnet派生的:
require 'word'
data = Words::Wordnet.new
Nothing surprising 没什么奇怪的
ActiveRecord has no method rebuild-index ActiveRecord没有方法重建索引
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.