Skip to content

Instantly share code, notes, and snippets.

@nz
Last active October 1, 2015 18:58
Show Gist options
  • 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 [email protected].

  • 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 [email protected] if this is affecting you. Issue 386
  • ES Alias API not fully supported in Bonsai. Email [email protected] if you would like to beta test that.
@nz
Copy link
Author

nz commented Jul 19, 2013

Hi @criscrossed, you should email [email protected] with your account information so I can check that out.

@nz
Copy link
Author

nz commented Oct 20, 2013

Updated the setup instructions to remove the "optional" combined index strategy. Our plans offer sufficient shards these days to support most common index-per-model sharding strategies.

@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