-
Couldn't load subscription status.
- Fork 808
update document should update with hash from as_indexed_json. #182
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
Conversation
ksaveras
commented
Aug 19, 2014
+1
Well, #166 solves the problem of not using as_indexed_json to update the index. However, it is still limited to the attribute keys returned by changed_attriubtes which only watches changes in field attributes. If a custom key value (some derived value) is added within as_indexed_json, that key value change is not being watched. Hence if there's a change in that value, the change is not reflected in the index. Therefore my solution deletes the unchanged key-values instead of selecting the changed key-values. This will insure that any custom key value pair will be included in the update. This was my issue in #178.
e5ae1ad to
d29f270
Compare
afn
commented
Dec 3, 2014
Can this be merged? The build failures appear to be spurious.
afn
commented
Feb 24, 2015
Any update on this?
Meekohi
commented
Jul 17, 2017
Hate to just +1 an issue, but this is the same problem I'm having as well and a little lost. Are there any work-arounds in the meantime for "forcing" a derived field to get sent along with ES updates?
Okay dug around in this more today and personally I like the @dwkoogt solution.
- It is exactly the same if you don't use
as_indexed_json - It is exactly the same if you use
as_indexed_jsonbut only with real attributes (i.e. that can be tracked inchanged_attributes) - If you use computed attributes or methods in
as_indexed_json(i.e. anything that can not be tracked inchanged_attributes) it conservatively sends those along during updates.
In my opinion this is a pretty significant and sneaky bug that should be fixed.
@karmi "It certainly cannot be merged as is... We can absolutely have talk about the problem there."
Could you let us know what needs to be improved here to have it merged? I'd be willing to spend some time on this.
...uld also contain derived attributes.
...selected for specific changed attribute.
d0ab82d to
5cc68b5
Compare
Hi @karmi, just updated my profile with the email address. thx.
@Meekohi
Meekohi
Aug 25, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change for performance? Original version seemed more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My original change included with_indifferent_access method which is a rails extension which I removed here.
Btw, I rebased on master and Travis is failing on this:
$ curl -sS https://snapshots.elastic.co/downloads/elasticsearch/elasticsearch-6.0.0-alpha1-SNAPSHOT.tar.gz | tar xz -C /tmp
Meekohi
commented
Oct 5, 2017
@karmi any updates on what needs to happen here?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
update document should update with hash from as_indexed_json which could also contain derived attributes.
resolves #178
this also should resolve issues #88 #166 and #195