ruby on rails - Update ElasticSearch mapping in production (Tire) -


i have clear understanding on how deal following scenario:

i'm adding or removing attribute activerecord model, want update mapping in elasticsearch, in production.

from understood, should...

1- create new index , import mysql

is right command? rake environment tire:import class='bow' index='new-bows' create right mapping, should have updated mapping in model, right?

2- delete old mapping , create alias named bows new-bows

i that, correct?

old_index_name = bow.tire.index.name bow.tire.index.delete alias = tire::alias.new alias.name(old_index_name) alias.index('new-bows') alias.save 

3- restart app


am missing something, or there simpler way achieve want using tire?

at point should delete old index? before creating alias same name, or can after?

you should keep old index around until you're sure new index 100% want. can flip alias if not case.

there's integration test in tire test suite "flipping aliases".


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -