toptal / chewy

High-level Elasticsearch Ruby framework based on the official elasticsearch-ruby client
MIT License
1.89k stars 368 forks source link

Best way to import large objects? #315

Closed illogikal closed 7 years ago

illogikal commented 8 years ago

I am migrating from another search service to elastic search on an app. I have defined the index (20 fields, 10 nested multilevel objects) and when I try to index, I am getting a stack level too deep error. I am using grape entities to serialise the json for the nested models (some of them also contain dynamic field names) like this:

field :the_model, type: 'object', value: ->{ TheModel::Entity.represent(the_model).as_json }

Have looked on stack overflow, but since there is nothing on there, I decided to post here. I know that it is because of the depth of the objects, because when I remove a couple, the error goes away.

Am using the latest version of chewy, with grape and grape entities, and running locally.

pyromaniac commented 8 years ago

You probably have to find out where the exact error happens because it seems like it happens in your code, outside of chewy