toptal / chewy

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

"#<Chewy::UndefinedUpdateStrategy: Index update strategy is undefined for current context.\n Please wrap your code with `Chewy.strategy(:strategy_name) block.`\n>"} #910

Closed Bhumika2015 closed 7 months ago

Bhumika2015 commented 9 months ago

"#<Chewy::UndefinedUpdateStrategy: Index update strategy is undefined for current context.\n Please wrap your code with Chewy.strategy(:strategy_name) block.\n>"

I'm getting this while bulk importing.

konalegi commented 8 months ago

could you please elaborate a bit? What exactly you do?

smarquezs commented 7 months ago

We recently updated to the latest Rails version (7.1.2) and encountered the same issue with Chewy::Strategy::ActiveJob::Worker. We resolved it by adding Chewy.root_strategy = :active_job. Note that we use DelayedJob for background jobs. You can review the documentation to find the strategy that best fits your requirements.

https://github.com/toptal/chewy#index-update-strategies

Bhumika2015 commented 7 months ago

It's working fine for me. As I used Chewy.strategy(:urgent) in my code.