[英]Conditionally index document for elasticsearch using Tire
I worked out solution. 我制定了解决方案。 I removed this callback include from my model: 我从模型中删除了此回调包含:
include Tire::Model::Callbacks
and implemented my own callback like this: 并实现了我自己的回调,如下所示:
after_save do
if live == true
self.index.store self
else
self.index.remove self
end
end
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.