chewy icon indicating copy to clipboard operation
chewy copied to clipboard

Sidekiq indexing strategy fails with NoMethodError

Open fabiendv opened this issue 1 year ago • 0 comments

I have a basic implementation of a user model with indexing, following the documentation precisely. However, the index is not processed because the associated job does not execute successfully.

For instance:

  • When I create a user, it is not indexed.
  • Similarly, deletions are not reflected in the index.

Expected behavior

The job should execute without errors.

Actual behavior

The job fails with the following error:

 NoMethodError: undefined method `dig' for "UsersIndex":String

Steps to reproduce the problem

user.rb

update_index('users') { self }

users_index.rb

class UsersIndex < Chewy::Index

  index_scope User

  field :id, type: 'integer'
  ...

end

chewy.rb

Chewy.root_strategy = :sidekiq
Chewy.request_strategy = :sidekiq

Version Information

  • Chewy version 7.6.0
  • Elasticsearch version 8.16.0
  • Ruby version 3.2.2
  • Rails version 7.1.4.1

fabiendv avatar Dec 04 '24 11:12 fabiendv