Skip to content

Sidekiq indexing strategy fails with NoMethodError #974

@fabiendv

Description

@fabiendv

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions