Skip to content

MeiliSearch::Rails::MSCleanUpJob 404 error when deleting records #352

@drale2k

Description

@drale2k

Description
When i delete a record in my rails app which has meilisearch indexing set up, the background job fails with the following error:
Error: MeiliSearch::ApiError: 404 Not Found - MeiliSearch API has not returned any error message. See <no documentation link found>.

Arguments:
[{"index_uid"=>nil, "primary_key"=>"45", "synchronous"=>nil, "_aj_hash_with_indifferent_access"=>true}]

For some reason index_uid is nil and it cannot find the record. My model setup is pretty straight forward

class Episode < ApplicationRecord
  include MeiliSearch::Rails

  ...

  meilisearch enqueue: true do
    attributes :title, :body

    attribute(:categories) { video.categories.pluck(:name) }
    attribute(:published_at) { published_at&.to_i }

    searchable_attributes [ :title, :body ]
    filterable_attributes [ :categories ]
    sortable_attributes [ :created_at ]

    attributes_to_highlight [ "*" ]
    attributes_to_crop [ :description, :transcript ]
    crop_length 50
  end
end

Expected behavior
The document to be deleted from the Meilisearch Index

Current behavior
Error explained above

Screenshots or Logs
If applicable, add screenshots or logs to help explain your problem.

Environment (please complete the following information):

  • OS: Development ENV on macOS
  • Meilisearch server version: Meilisearch Cloud (latest)
  • meilisearch-rails version: v0.12.0
  • Rails version: v7.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions