searchkick icon indicating copy to clipboard operation
searchkick copied to clipboard

minor issue when when doing a full reindex in queue mode

Open goromlagche opened this issue 2 years ago • 0 comments

Describe the bug Not necessarily a bug, but there are some gotchas when trying to do a full reindex with queue mode,

e.g.

Product.reindex(mode: queue)
Searchkick::ProcessQueueJob.perform_later(class_name: "Product")

Does not work as intended.

this does

Product.reindex(mode: queue)
Searchkick::ProcessQueueJob.perform_later(class_name: "Product", index_name: "new_product_index_with_timestamp")

My guess is https://github.com/ankane/searchkick/blob/a68267718cbd30db322b8edc7a878978eb6906cc/lib/searchkick/record_indexer.rb#L51 in here index is the raw index. reindex_queue.send(:redis_key) will return new_product_index_with_timestamp

But when process queue job pulls in the data https://github.com/ankane/searchkick/blob/a68267718cbd30db322b8edc7a878978eb6906cc/lib/searchkick/process_queue_job.rb#L11 it uses alias.

It will be good to update to fix the code path to always use alias name. Or update the readme with a note.

goromlagche avatar Nov 20 '23 09:11 goromlagche