Created
March 5, 2015 09:37
-
-
Save revis0r/6b4a5a806da14f01f3b8 to your computer and use it in GitHub Desktop.
move logs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new_version = 2 | |
Tire.index "#{Settings::ElasticSearch.index}_v#{new_version}" do | |
delete | |
create :mappings => { | |
:Log => { | |
:properties => { | |
:id => { type: 'string', index: "not_analyzed", norms: { enabled: false }, include_in_all: false }, | |
:object_id => { type: 'string', index: "not_analyzed", norms: { enabled: false }, include_in_all: false }, | |
:company => { type: 'string', index: "not_analyzed", norms: { enabled: false }, include_in_all: false }, | |
:domain => { type: 'string', index: "not_analyzed", norms: { enabled: false }, include_in_all: false }, | |
:message => { type: 'string', analyzer: 'snowball' }, | |
:controller => { type: 'string', index: "not_analyzed", norms: { enabled: false }, include_in_all: false }, | |
:new_attributes_values => { type: 'object', index: "not_analyzed", norms: { enabled: false }, include_in_all: false }, | |
:old_attributes_values => { type: 'object', index: "not_analyzed", norms: {enabled: false}, include_in_all: false }, | |
:timestamp => { type: 'date', format: "date_time", index: "not_analyzed", norms:{ enabled: false }, include_in_all: false } | |
} | |
} | |
} | |
end | |
Tire.index "otp" do | |
reindex "#{Settings::ElasticSearch.index}_v#{new_version}" | |
end | |
Tire::Alias.create name: Settings::ElasticSearch.index, indices: ["#{Settings::ElasticSearch.index}_v#{new_version}"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment