{"record":{"id":"bad3ac43aae337ed","repo":"ankane/searchkick","slug":"the-conversions-option-is-deprecated-in-favor-of-bad3ac","errorCode":null,"errorMessage":"The `conversions` option is deprecated in favor of `conversions_v2`, which provides much better search performance. Upgrade to `conversions_v2` or rename `conversions` to `conversions_v1`","messagePattern":"The `conversions` option is deprecated in favor of `conversions_v2`, which provides much better search performance\\. Upgrade to `conversions_v2` or rename `conversions` to `conversions_v1`","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"lib/searchkick/query.rb","lineNumber":21,"sourceCode":"    include Enumerable\n    extend Forwardable\n\n    @@metric_aggs = [:avg, :cardinality, :max, :min, :sum]\n\n    attr_reader :klass, :term, :options\n    attr_accessor :body\n\n    def_delegators :execute, :map, :each, :any?, :empty?, :size, :length, :slice, :[], :to_ary,\n      :results, :suggestions, :each_with_hit, :with_details, :aggregations, :aggs,\n      :took, :error, :model_name, :entry_name, :total_count, :total_entries,\n      :current_page, :per_page, :limit_value, :padding, :total_pages, :num_pages,\n      :offset_value, :offset, :previous_page, :prev_page, :next_page, :first_page?, :last_page?,\n      :out_of_range?, :hits, :response, :to_a, :first, :scroll, :highlights, :with_highlights,\n      :with_score, :misspellings?, :scroll_id, :clear_scroll, :missing_records, :with_hit\n\n    def initialize(klass, term = \"*\", **options)\n      if options[:conversions]\n        Searchkick.warn(\"The `conversions` option is deprecated in favor of `conversions_v2`, which provides much better search performance. Upgrade to `conversions_v2` or rename `conversions` to `conversions_v1`\")\n      end\n\n      if options.key?(:conversions_v1)\n        options[:conversions] = options.delete(:conversions_v1)\n      end\n\n      unknown_keywords = options.keys - [:aggs, :block, :body, :body_options, :boost,\n        :boost_by, :boost_by_distance, :boost_by_recency, :boost_where, :conversions, :conversions_v2, :conversions_term, :debug, :emoji, :exclude, :explain,\n        :fields, :highlight, :includes, :index_name, :indices_boost, :knn, :limit, :load,\n        :match, :misspellings, :models, :model_includes, :offset, :opaque_id, :operator, :order, :padding, :page, :per_page, :profile,\n        :request_params, :routing, :scope_results, :scroll, :select, :similar, :smart_aggs, :suggest, :total_entries, :track, :type, :where]\n      raise ArgumentError, \"unknown keywords: #{unknown_keywords.join(\", \")}\" if unknown_keywords.any?\n\n      term = term.to_s\n\n      if options[:emoji]\n        term = EmojiParser.parse_unicode(term) { |e| \" #{e.name.tr('_', ' ')} \" }.strip\n      end","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/ankane/searchkick/blob/93e901a75b11a25101668a616e006b158251b16e/lib/searchkick/query.rb#L3-L39","documentation":"The same deprecation notice as the model-level one, but printed from Query#initialize (query.rb:22-28) when `conversions:` is passed to a search call, e.g. `Product.search('banana', conversions: true)`. The option is still honored (and `conversions_v1` is mapped back onto `:conversions`, query.rb:30-32), but Searchkick warns that v2 provides better performance. Output goes through Searchkick.warn as `[searchkick] WARNING: ...`; it is not an exception.","triggerScenarios":"Every search call passing the option: `Product.search('banana', conversions: true)` or `conversions: [:field]`, including via search scopes/relations. Fires once per query construction, so hot paths warn on every request after upgrading Searchkick to 5+.","commonSituations":"Per-query personalized search tuned with legacy options; codebases upgrading Searchkick where old calls still pass `conversions:`; log noise from warnings emitted on every search request until migrated.","solutions":["Rename the query option to `conversions_v1: true` to keep behavior and silence the warning","Migrate the model to `conversions_v2: [...]` fields, reindex, and drop query-level `conversions` - boosting then comes from the v2 subfield automatically","Remove the per-query option if conversion boosting is not needed"],"exampleFix":"# before\nProduct.search(\"banana\", conversions: true)\n\n# after\nProduct.search(\"banana\", conversions_v1: true)\n# or, once the model defines conversions_v2 and data is reindexed:\nProduct.search(\"banana\")","handlingStrategy":"fallback","validationCode":"# Normalize options in one place before they reach Searchkick\ndef product_search(term, **options)\n  options[:conversions_v1] = options.delete(:conversions) if options.key?(:conversions)\n  Product.search(term, **options)\nend","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Wrap all search calls in one helper so deprecated options are normalized centrally","Pin the Searchkick version and read its CHANGELOG deprecations before upgrading","Assert in tests that request logs contain no '[searchkick] WARNING'"],"tags":["searchkick","deprecation","conversions","search-options","ruby"],"backgroundTag":"deprecation-warning","analyzedSha":"93e901a75b11a25101668a616e006b158251b16e","analyzedAt":"2026-08-21T19:06:23.767Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}