diff --git a/lib/searchkick.rb b/lib/searchkick.rb index 63f0790..4fd68d2 100644 --- a/lib/searchkick.rb +++ b/lib/searchkick.rb @@ -48,7 +48,7 @@ module Searchkick class ImportError < Error; end class << self - attr_accessor :search_method_name, :wordnet_path, :timeout, :models, :client_options, :redis, :index_prefix, :index_suffix, :queue_name + attr_accessor :search_method_name, :wordnet_path, :timeout, :models, :client_options, :redis, :index_prefix, :index_suffix, :queue_name, :model_options attr_writer :client, :env, :search_timeout attr_reader :aws_credentials end @@ -58,6 +58,7 @@ module Searchkick self.models = [] self.client_options = {} self.queue_name = :searchkick + self.model_options = {} def self.client @client ||= begin diff --git a/lib/searchkick/model.rb b/lib/searchkick/model.rb index b8267fb..4f64c00 100644 --- a/lib/searchkick/model.rb +++ b/lib/searchkick/model.rb @@ -1,6 +1,8 @@ module Searchkick module Model def searchkick(**options) + options = Searchkick.model_options.merge(options) + unknown_keywords = options.keys - [:_all, :_type, :batch_size, :callbacks, :conversions, :default_fields, :filterable, :geo_shape, :highlight, :ignore_above, :index_name, :index_prefix, :inheritance, :language, :locations, :mappings, :match, :merge_mappings, :routing, :searchable, :settings, :similarity, -- libgit2 0.21.0