Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It looks like you should do this in your deployment using Capistrano. Here is an example config/deploy.rb file:</p> <pre><code>[basic parts omitted] after "deploy", "bundler:bundle_install" after "bundler:bundle_install", "db:db_migrate" after "deploy:db_migrate", "deploy:elastic_search_indexing" namespace :bundler do desc 'call bundle install' task :bundle_install do run "cd #{deploy_to}/current &amp;&amp; bundle install" end end namespace :db do desc 'fire the db migrations' task :db_migrate do run "cd #{deploy_to}/current &amp;&amp; bundle exec rake db:migrate RAILS_ENV=\"production\"" end end namespace :elasticsearch do desc 'run elasticsearch indexing via tire' task :index_classes do run "cd #{deploy_to}/current &amp;&amp; bundle exec rake environment tire:import CLASS=YourObject FORCE=true " end end [rest omitted] </code></pre> <p>Make sure you have a config file on the target machine (Linux) in /etc/elasticsearch/elasticsearch.yml with contents like:</p> <pre><code>cluster: name: elasticsearch_server network: host: 66.98.23.12 </code></pre> <p>And the last point to mention is that you should create an initializer config/initializers/tire.rb:</p> <pre><code>if Rails.env == 'production' Tire.configure do url "http://66.98.23.12:9200" end end </code></pre> <p>As you can see, this is the exact same IP address, but only used for the production environment. I assume that you access elasticsearch locally (in development mode) via localhost. elasticsearch is connection per default to </p> <pre><code> http://0.0.0.0:9200 </code></pre> <p>A good starting point and also in depth help is provided by awesome Ryan Bates and his Railscasts <a href="http://railscasts.com/episodes?utf8=%E2%9C%93&amp;search=capistrano" rel="nofollow">http://railscasts.com/episodes?utf8=%E2%9C%93&amp;search=capistrano</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload