Coder Social home page Coder Social logo

Comments (7)

palanglung avatar palanglung commented on September 24, 2024

+1
the changed_attributes should filtered as like as_indexed_json cause maybe not all fields are public and used for indexing.

from elasticsearch-rails.

fcheung avatar fcheung commented on September 24, 2024

If we did want to make this work beyond trivial cases perhaps ES::Model should be asking the instance for updates rather than taking them out of changed attributes. There could always be a default implementation that just returned the changed attributes.

On the otherhand perhaps the pragmatic thing is to just write your own update_document if you have that need.

from elasticsearch-rails.

samqiu avatar samqiu commented on September 24, 2024

Please see #5 .

from elasticsearch-rails.

fcheung avatar fcheung commented on September 24, 2024

D'oh - I'm a dummy. Given that the conclusion has been reached that the library shouldn't be trying to do anything smart in this case, perhaps the documentation should reflect this?

from elasticsearch-rails.

spodlecki avatar spodlecki commented on September 24, 2024

+1 to document it's behavior in README. I had custom callbacks, and it would not update the serialized json field. The solution was to just use es.index_document on the models that have serialized fields versus update_document. Its a bit of a performance killer most likely, but it works and is only updated on a cron job every 20 mins.

from elasticsearch-rails.

karmi avatar karmi commented on September 24, 2024

@fcheung I'm still thinking whether we can somehow intercept the changes better, but I don't think so. It would be nice to check whether the model itself (and not the proxy) implements the as_indexed_method...

from elasticsearch-rails.

karmi avatar karmi commented on September 24, 2024

@fcheung Actually, the simple case was quite simple to solve, unless I'm missing something very obvious -- please check the linked commit.

from elasticsearch-rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.