Create environment specific index name for papers

This will require re-indexing your development database
This commit is contained in:
Lars Henrik Mai 2016-02-17 20:45:29 +01:00
parent 8f4342919f
commit d790e97535

View file

@ -19,6 +19,8 @@ class Paper < ActiveRecord::Base
validates :published_at, presence: true, parseable_date: true
validates :resolution, length: { maximum: 30_000 }
index_name ['srm', Rails.env, self.base_class.to_s.pluralize.underscore].join('_')
settings index: { number_of_shards: 1 } do
mappings dynamic: false do
indexes :name, type: :string, analyzer: "german"