searchkick: Installing WordNet does not work
I am trying out searchkick.
After making sure the basic Elasticsearch worked properly, I wanted to see what WordNet would do.
I copied the command line instructions that are stated in the guide. The wn_s.pl
perl file got stored in /var/lib
without problems. But when I then try to reindex my models (that now have the line searchkick wordnet: true
), I get the following error:
Reindexing WorldObject...
rake aborted!
Elasticsearch::Transport::Transport::Errors::InternalServerError: [500] {"error":{"root_cause":[{"type":"index_creation_exception","reason":"failed to create index"}],"type":"access_control_exception","reason":"access denied (\"java.io.FilePermission\" \"/var/lib/wn_s.pl\" \"read\")"},"status":500}
/home/qqwy/.rvm/gems/ruby-2.2.1/gems/elasticsearch-transport-1.0.14/lib/elasticsearch/transport/transport/base.rb:136:in `__raise_transport_error'
/home/qqwy/.rvm/gems/ruby-2.2.1/gems/elasticsearch-transport-1.0.14/lib/elasticsearch/transport/transport/base.rb:228:in `perform_request'
/home/qqwy/.rvm/gems/ruby-2.2.1/gems/elasticsearch-transport-1.0.14/lib/elasticsearch/transport/transport/http/faraday.rb:20:in `perform_request'
/home/qqwy/.rvm/gems/ruby-2.2.1/gems/elasticsearch-transport-1.0.14/lib/elasticsearch/transport/client.rb:119:in `perform_request'
/home/qqwy/.rvm/gems/ruby-2.2.1/gems/elasticsearch-api-1.0.14/lib/elasticsearch/api/namespace/common.rb:21:in `perform_request'
/home/qqwy/.rvm/gems/ruby-2.2.1/gems/elasticsearch-api-1.0.14/lib/elasticsearch/api/actions/indices/create.rb:77:in `create'
/home/qqwy/.rvm/gems/ruby-2.2.1/gems/searchkick-1.0.1/lib/searchkick/index.rb:11:in `create'
/home/qqwy/.rvm/gems/ruby-2.2.1/gems/searchkick-1.0.1/lib/searchkick/index.rb:134:in `create_index'
/home/qqwy/.rvm/gems/ruby-2.2.1/gems/searchkick-1.0.1/lib/searchkick/index.rb:155:in `reindex_scope'
/home/qqwy/.rvm/gems/ruby-2.2.1/gems/searchkick-1.0.1/lib/searchkick/model.rb:51:in `searchkick_reindex'
/home/qqwy/.rvm/gems/ruby-2.2.1/gems/searchkick-1.0.1/lib/searchkick/tasks.rb:26:in `block (4 levels) in <top (required)>'
/home/qqwy/.rvm/gems/ruby-2.2.1/gems/searchkick-1.0.1/lib/searchkick/tasks.rb:24:in `each'
/home/qqwy/.rvm/gems/ruby-2.2.1/gems/searchkick-1.0.1/lib/searchkick/tasks.rb:24:in `block (3 levels) in <top (required)>'
Tasks: TOP => searchkick:reindex:all
I have tried changing the file permissions of the /var/lib/wn_s.pl
file so that anyone can read and write to it, but this does not solve the problem.
What is going on?
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 1
- Comments: 15 (3 by maintainers)
How does this work when Elasticsearch is on a different server from the client/Rails server? I can only get it working as above, ie with an initializer indicating the correct location. On a separate server, it always fails on /var/lib.
I managed to get it to work.
Find out what is the home dir for elasticsearch, on ubuntu it was
/etc/elasticsearch
sudo cp wn_s.pl /etc/elasticsearch
sudo chown elasticsearch:elasticsearch /etc/elasticsearch/wn_s.pl
Create a new initializer in the
config/initializers
directorysearchkick.rb
with the following:Searchkick.wordnet_path = '/etc/elasticsearch/wn_s.pl'