Skip to content

Instantly share code, notes, and snippets.

@nz
Last active October 1, 2015 18:58
Show Gist options
  • Star 26 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save nz/2041121 to your computer and use it in GitHub Desktop.
Save nz/2041121 to your computer and use it in GitHub Desktop.
Configuring Tire to work with Bonsai

1. Configure Tire to use the Bonsai ElasticSearch Heroku add-on

gem 'tire'

config/initializers/bonsai.rb

ENV['ELASTICSEARCH_URL'] = ENV['BONSAI_URL']

app/models/article.rb

class Article
  include Tire::Model::Search
  include Tire::Model::Callbacks
end

2. Create the index and import your documents

rake environment tire:import CLASS=Article FORCE=true

Known issues

There are no "known issues" with Tire and Bonsai at the moment. Having trouble with something in particular? Drop us a line at support@bonsai.io.

  • Custom index analyzers must be set at index creation time. Ability to dynamically create, modify and destroy indexes.
  • Bulk import uses cluster-level /_bulk handler rather than the index-level _bulk handler, causing bulk imports to fail. Issue 327
  • Multi-model search is not scoped within the index. Issue 322
  • Undefined method [] for nil:NilClass on index.settings. Bonsai shared cluster indices are mapped to a random identifier, whereas Tire expects the logical index name in the _index response. To be fixed within Bonsai. Email support@bonsai.io if this is affecting you. Issue 386
  • ES Alias API not fully supported in Bonsai. Email support@bonsai.io if you would like to beta test that.
@ralphamale
Copy link

@nz - have you switched over to elasticsearch-rails gem? i'm trying to install it and it's giving me problems with Faraday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment