workarea-commerce / workarea-api

Adds JSON REST APIs to the Workarea Commerce Platform
https://www.workarea.com
Other
7 stars 1 forks source link

Use Bulk Indexing during Bulk operations #28

Open mcfearsome opened 3 years ago

mcfearsome commented 3 years ago

Is your feature request related to a problem? Please describe. While doing performance reviews I noticed that the API bulk operations don't make use of bulk indexing as far as I can tell. Not a problem per se, just seems like an obvious improvement.

Describe the solution you'd like Modify Workarea::Api::Admin::BulkUpsert#perform! to disable normal indexing callbacks and collect the models being changed so you can then call the bulk method on the ES Document classes.

bencrouse commented 3 years ago

Just a note for now: doing this would mean the bulk upsert job would take significantly longer and use significantly more memory, so a bit of a tradeoff here.