{"record":{"id":"c568dd04f8217e30","repo":"ankane/searchkick","slug":"full-reindex-does-not-support-queue-mode-use-a","errorCode":null,"errorMessage":"Full reindex does not support :queue mode - use :async mode instead","messagePattern":"Full reindex does not support :queue mode - use :async mode instead","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/searchkick/index.rb","lineNumber":365,"sourceCode":"\n    def import_before_promotion(index, relation, **import_options)\n      index.import_scope(relation, **import_options)\n    end\n\n    def reindex_records(object, mode: nil, refresh: false, **options)\n      mode ||= Searchkick.callbacks_value || @options[:callbacks] || :inline\n      mode = :inline if mode == :bulk\n\n      result = RecordIndexer.new(self).reindex(object, mode: mode, full: false, **options)\n      self.refresh if refresh\n      result\n    end\n\n    # https://gist.github.com/jarosan/3124884\n    # https://www.elastic.co/blog/changing-mapping-with-zero-downtime/\n    def full_reindex(relation, import: true, resume: false, retain: false, mode: nil, refresh_interval: nil, scope: nil, wait: nil, job_options: nil)\n      raise ArgumentError, \"wait only available in :async mode\" if !wait.nil? && mode != :async\n      raise ArgumentError, \"Full reindex does not support :queue mode - use :async mode instead\" if mode == :queue\n\n      if resume\n        index_name = all_indices.sort.last\n        raise Error, \"No index to resume\" unless index_name\n        index = Index.new(index_name, @options)\n      else\n        clean_indices unless retain\n\n        index_options = relation.searchkick_index_options\n        index_options.deep_merge!(settings: {index: {refresh_interval: refresh_interval}}) if refresh_interval\n        index = create_index(index_options: index_options)\n      end\n\n      import_options = {\n        mode: (mode || :inline),\n        full: true,\n        resume: resume,\n        scope: scope,","sourceCodeStart":347,"sourceCodeEnd":383,"githubUrl":"https://github.com/ankane/searchkick/blob/93e901a75b11a25101668a616e006b158251b16e/lib/searchkick/index.rb#L347-L383","documentation":"mode: :queue pushes record ids onto a Redis queue for a background worker to bulk-process, so it can only reindex the record's full search data. Passing method_name - a partial reindex such as reindex(:search_data) or reindex(some_serializer_method) - together with mode: :queue raises Error 'Partial reindex not supported with queue option', because the queued job would not know which method to call.","triggerScenarios":"Product.reindex(:now_index, mode: :queue); Product.where(active: true).reindex(:search_data, mode: :queue) - any method-name argument combined with queue mode.","commonSituations":"Switching an existing partial reindex call (used to refresh denormalized index data) to queue mode for performance; adding queue_name to a model and forgetting a call site that passes a method name.","solutions":["Drop the method name so full search data is queued: records.reindex(mode: :queue)","Keep the partial reindex but use mode: :async - Active Job reindex jobs support method_name","Refactor the method's data into search_data so a full reindex produces the same result"],"exampleFix":"# before\nProduct.reindex(:search_data, mode: :queue)\n# => Searchkick::Error: Partial reindex not supported with queue option\n\n# after - choose one\nProduct.reindex(mode: :queue)                 # full reindex via queue\nProduct.reindex(:search_data, mode: :async)   # partial via Active Job","handlingStrategy":"validation","validationCode":"def schedule_reindex(records, method_name: nil, mode:)\n  if mode == :queue\n    raise ArgumentError, 'partial reindex unsupported with :queue' if method_name\n    records.reindex(mode: :queue)\n  else\n    records.reindex(method_name, mode: mode)\n  end\nend","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Route all reindex calls through one service method that rejects method_name+queue up front","Default mode per job type (full -> queue, partial -> async) in config","Log which mode/method combos are used so mismatches surface early"],"tags":["searchkick","reindex","queue-mode","partial-reindex"],"backgroundTag":"unsupported-option-combination","analyzedSha":"93e901a75b11a25101668a616e006b158251b16e","analyzedAt":"2026-08-21T19:06:23.767Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}