简体   繁体   中英

Tire - Elasticsearch - how to skip indexing on create?

I' m working on a rails app. using gem tire as a bond for elasticsearch. in a multistep form I would like to index at the end of the procedure.

is there a way of skipping indexing on create.

guess: Post.create( :indexing => false ) or whatever

or in tire config say : only index Post with attribute :published set to true

Hope I made myself clear. thanks in advance for your answers.

Cheers.

re: your answer above, after_save is called on create too so a better, more general answer to your question (i think) would be to make sure not to include Tire::Model::Callbacks in your model then

after_create :my_callback

def my_callback
  false
end

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM