You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a voter is created and indexed, the searching the index should return the voter. This is how everything worked on the previous gem versions.
Attempted solution
I experimented and added refresh_interval: "1s" to our settings hash, and the expected behavior has resumed.
classVoter < ApplicationRecordincludeElasticsearch::Model# ...# All kinds of business code# ..settingsindex: {refresh_interval: "1s",analysis: {# same as above},analyzer: {# same as above},autocomplete: {# same as above},autocomplete_search: {# same as above}}}}domappingsdynamic: falsedo# Specify a bunch of indexes in hereendendend
This worked temporarily then stopped working. I've now had to add Voter.__elasticsearch__.refresh_index! for the updates in the index to appear.
We have other models that the indexes are updating, but they are not using the index: {} hash in the settings method at all. This seems to be the only outlying difference.
The text was updated successfully, but these errors were encountered:
crimson-knight
changed the title
refresh_interval being unset if a value is not specified when using settings
Indexes are not refreshing, even with refresh_interval being set
Aug 26, 2022
I ran into this situation after doing a ruby & rails upgrade (rails 6.0.x -> 6.1.x, ruby 2.7.x -> ruby 3.1.x)
We have a model setup similarly to this:
This was working before we did the upgrade. Here's the command and diff output to show the gem versions that changed:
Expected Behavior:
When a voter is created and indexed, the searching the index should return the voter. This is how everything worked on the previous gem versions.
Attempted solution
I experimented and added
refresh_interval: "1s"
to our settings hash, and the expected behavior has resumed.This worked temporarily then stopped working. I've now had to add
Voter.__elasticsearch__.refresh_index!
for the updates in the index to appear.We have other models that the indexes are updating, but they are not using the
index: {}
hash in thesettings
method at all. This seems to be the only outlying difference.The text was updated successfully, but these errors were encountered: