-
Notifications
You must be signed in to change notification settings - Fork 470
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
Updating associated models with SQL-backed models and delta indexes #1182
Comments
The same behaviour as what’s offered for real-time indices, but fires off delta callbacks instead, as prompted by #1182. At this point it’s quite a simple implementation: the `:path` option is used to go back to the associated model via an array of method names, and updates the `delta` column to true for that object. It’s not yet flexible enough to handle delta columns with non-standard names, but it’s enough to prove the concept.
I've pushed a commit to |
@pat Thanks for the fix. It works good on an update, but when I delete a
|
Also... not sure if I'm doing it wrong, but if a new |
So I ended up getting the Greasy Spoon code working on my machine to test out these issues myself :) The deletion issue was because when a user is deleted, the associated scripts are deleted as well - and so, the script instances are frozen. I've just pushed a commit that handles this - it won't fire off a delta update for the script, because it won't exist, but the callbacks in Script should cover off marking the sphinx record as deleted. As for updates: given it's actually the Author model that ties the two together, I'd recommend adding the TS association callbacks to Author as well:
|
Delete issue is fixed, thanks. It's not actually a new |
Nevermind, the test was wrong, not thinking-sphinx. Thanks for the prompt fixes! |
No worries, thanks for the testing :) |
A
Script
has a many-to-many relationship with aUser
. TheUser
's name is part of theScript
index.I'm upgrading to thinking-sphinx 5.0.0. I've added:
to
Script
; works good, updates toScript
trigger a delta job.I'm having trouble making updates to
User
trigger deltas jobs for the associatedScript
s. I've triedand
in the
User
model - doesn't seem to do anything. How do I get this to work?The text was updated successfully, but these errors were encountered: