Upgrading from 0.3.x to 0.4.x

Version 0.4.0 moved the :bulk_page_size and :bulk_wait_interval settings into each index's configuration, rather than global on the cluster.

Rationale

This makes it easier to have different bulk settings for different indexes.

Changes

BREAKING: :bulk_page_size and :bulk_wait_interval are now configured on the index, not the cluster.

Elasticsearch.Index.hot_swap/5 is now Elasticsearch.Index.hot_swap/3 where options are passed as a map.

FEATURE: You can now pass --bulk-wait-interval and --bulk-page-size options to mix elasticsearch.build, as requested in #26.

How to Update Your App

Move the :bulk_page_size and :bulk_wait_interval settings to your index rather than your entire cluster.

# BEFORE
config :my_app, MyApp.ElasticsearchCluster,
  api: Elasticsearch.API.HTTP,
  json_library: Poison,
  url: "http://localhost:9200",
  username: "username",
  password: "password",
  bulk_page_size: 5000,
  bulk_wait_interval: 0,
  indexes: %{
    posts: %{
      settings: "test/support/settings/posts.json",
      store: Elasticsearch.Test.Store,
      sources: [Post]
    }
  }

# AFTER
config :my_app, MyApp.ElasticsearchCluster,
  api: Elasticsearch.API.HTTP,
  json_library: Poison,
  url: "http://localhost:9200",
  username: "username",
  password: "password",
  indexes: %{
    posts: %{
      settings: "test/support/settings/posts.json",
      store: Elasticsearch.Test.Store,
      sources: [Post],
      bulk_page_size: 5000,
      bulk_wait_interval: 0
    }
  }

Change the Elasticsearch.Index.hot_swap/5 call to Elasticsearch.Index.hot_swap/3

# BEFORE
Elasticsearch.Index.hot_swap(MyApp.Cluster, "index-name", "path/to/settings", MyApp.Store, [MyApp.Source])

# AFTER
Elasticsearch.Index.hot_swap(MyApp.Cluster, "index-name", %{settings: "path/to/settings", store: MyApp.Store, sources: [MyApp.Source]})