문제

First, I logged into the ruby script/console -e production and tried to index each table using

Model.rebuild_index 

It worked fine and returned 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

도움이 되었습니까?

해결책

Installed the copy of the wordnet data files for OS using :

sudo apt-get install wordnet-base

Word is actually derived from Wordnet :

require 'word'
data =  Words::Wordnet.new

다른 팁

Nothing surprising
ActiveRecord has no method rebuild-index

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top