{"record":{"id":"7986ab0b127c1427","repo":"ankane/searchkick","slug":"invalid-value-for-mode","errorCode":null,"errorMessage":"Invalid value for mode","messagePattern":"Invalid value for mode","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/searchkick/record_indexer.rb","lineNumber":66,"sourceCode":"          Searchkick::BulkReindexJob.set(**job_options).perform_later(\n            class_name: records.first.class.searchkick_options[:class_name],\n            record_ids: records.map { |r| r.id.to_s },\n            index_name: index.name,\n            method_name: method_name ? method_name.to_s : nil,\n            **extra_options\n          )\n        end\n      when :queue\n        if method_name\n          raise Error, \"Partial reindex not supported with queue option\"\n        end\n\n        index.reindex_queue.push_records(records)\n      when true, :inline\n        index_records, other_records = records.partition { |r| index_record?(r) }\n        import_inline(index_records, !full ? other_records : [], method_name: method_name, ignore_missing: ignore_missing, single: single)\n      else\n        raise ArgumentError, \"Invalid value for mode\"\n      end\n\n      # return true like model and relation reindex for now\n      true\n    end\n\n    def reindex_items(klass, items, method_name:, ignore_missing:, single: false)\n      routing = items.to_h { |r| [r[:id], r[:routing]] }\n      record_ids = routing.keys\n\n      relation = Searchkick.load_records(klass, record_ids)\n      # call search_import even for single records for nested associations\n      relation = relation.search_import if relation.respond_to?(:search_import)\n      records = relation.select(&:should_index?)\n\n      # determine which records to delete\n      delete_ids = record_ids - records.map { |r| r.id.to_s }\n      delete_records =","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/ankane/searchkick/blob/93e901a75b11a25101668a616e006b158251b16e/lib/searchkick/record_indexer.rb#L48-L84","documentation":"Error \"Invalid value for mode\" thrown in ankane/searchkick.","triggerScenarios":"Thrown at lib/searchkick/record_indexer.rb:66 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93e901a75b11a25101668a616e006b158251b16e","analyzedAt":"2026-08-21T19:06:23.767Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}