Real time indexes not updating immediately

7 views
Skip to first unread message

stasch

unread,
Feb 16, 2024, 12:25:44 PMFeb 16
to Thinking Sphinx
I switched over from SQLbacked  to realtime indexes. It worked well in my development environment. I then deployed the changes to a staging site. I deleted everything in the binlog/staging directory and the db/sphinx/staging directory and did a ts:rebuild. For quite some time changes that I made to one of the indexed fields in one of the models didn't get picked up when I filtered that model on the change. It remained in the search results for the old value of the field. I was ready to throw in the towel when suddenly everything started working correctly! After a couple of hours!?

That was yesterday. Today I deployed the same changes to a sandbox site, doing exactly what I did on the staging site,  and I'm experiencing the same problem. It's been about well over an hour since I made a change and it's not showing up in the search results. Hopefully it will start working like the staging site did, but .....

Is there anything I can do to prevent this delay? Or at least monitor it somehow?

stasch

unread,
Feb 16, 2024, 3:21:52 PMFeb 16
to Thinking Sphinx
It's been over 3 hours and index has still not updated. The setup is identical to my staging environment in which it is working perfectly (although it took a couple of hours to get going).

stasch

unread,
Feb 17, 2024, 8:46:44 AMFeb 17
to Thinking Sphinx
Updates still not working in sandbox environment. Everything is identical to staging environment except using a different port.

stasch

unread,
Feb 17, 2024, 7:35:28 PMFeb 17
to Thinking Sphinx
It looks like it may be an issue with the workflow gem. We're trying to use the on transition event to run the callback that updates the index. It seems to not be running. If we happen to make another change to the record (besides the status) then the after save callback updates the index. If all we're changing is the status (the workflow transition) then the index doesn't update. Any thoughts?

stasch

unread,
Feb 17, 2024, 7:55:32 PMFeb 17
to Thinking Sphinx
Here's the code that should trigger the update but appears to not be doing so:

on_transition do |from, to, triggering_event, *event_args| 
   unless from == to 
      ThinkingSphinx::RealTime.callback_for(:scapp) 
   end 
end

Reply all
Reply to author
Forward
0 new messages