-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please document criteria for smart _changed? behavior better #140
Comments
I also find it super strange that yall do stuff like
but then only refer to |
Helps address the problems laid out in algolia#140
The methods we're defining are indeed not designed to be reimplemented. And the That being said, what you say about the I will rather spend some time improving the doc & behavior of the @vincentwoo to make sure I get this right; could you share with us what kind of |
No, it's just a relation. I want to index some models if they have a relation. Could easily be a proc. I don't think you should expose methods like |
You might want to come up with a scheme for algolia being aware of relation-dependencies. Right now I have to hack around updating certain objects if their dependents update. Doing something like |
@redox Did you update the docs on this? I'm having problems with |
Ping |
@redox What is the recommended way to tell Algolia when to or not to reindex? (Also could you talk to how to trigger reindexing when relations change?) @vincentwoo @jadercorrea Curious what workarounds do you use for this? |
I implemented my own _changed? functions for some attributes and manually trigger reindexing for others |
@vincentwoo Could you share those |
This issue's been open a couple years. Has the situation changed? I'm again running into a model performing way more updates than is necessary because of the limited ability of algoliasearch-rails to understand context. |
It looks like the This has probably cost us, oh, I don't know, thousands of dollars. |
It looks like the original PR that broke this behavior was #325 - an attempt to stay ahead of Rails 5 deprecations that broke everyone with |
@julienbourdeau could you help us improve the documentation of the |
Instead of trying to bandaid a docs change, this is a really big opportunity to fixed the change detection system holistically. Right now, to work within the bounds of the system you have setup, users need to be clever enough to realize they have to implement This is a pretty rough place to be. Instead, you could try asking the user to pre-declare all column names that are eventually used in the computation of the record, along with a fallback method a user can defined to take control over where the record should be reindexed at all. |
I'm working on the issue, I'll try to find a better solution. Ideally, I'd rather not ask the user to list all used attributes. |
You can ask for only the columns that you can't detect - e.g. columns used in computing virtual attributes, if/unless, and tags |
@vincentwoo Sorry for the BC break, I didn't see it coming 😞 I opened this PR #338, any feedback is very welcome. |
@vincentwoo I started refreshing the Rails docs, I'm almost done. You can find the preview here: https://deploy-preview-2711--algolia-doc.netlify.com/doc/framework-integration/rails/indexing/indexing/ I'll also release #338 which should fix your issue and restore BC. |
it goes unsaid, but if your setup uses tags or an
:if
or:unless
option, algoliasearch-rails will attempt to do things like examine_tags_changed?
and whatever your:if
condition symbol name is +_changed?
as well. this is pretty hard to track down if you're wondering why your app is doing a lot of frivolous updates.please also consider adding a method that can override
algolia_must_reindex?
entirely.The text was updated successfully, but these errors were encountered: