module ElasticSearch::Api::DefaultScope
Public Instance Methods
default_index()
click to toggle source
# File lib/elasticsearch/client/default_scope.rb, line 4 def default_index @default_index ||= @options[:index] end
default_index=(index)
click to toggle source
# File lib/elasticsearch/client/default_scope.rb, line 8 def default_index=(index) @default_index = index end
default_type()
click to toggle source
# File lib/elasticsearch/client/default_scope.rb, line 12 def default_type @default_type ||= @options[:type] end
default_type=(type)
click to toggle source
# File lib/elasticsearch/client/default_scope.rb, line 16 def default_type=(type) @default_type = type end
Private Instance Methods
extract_required_scope(options)
click to toggle source
# File lib/elasticsearch/client/default_scope.rb, line 29 def extract_required_scope(options) scope = extract_scope(options) raise "index and type or defaults required" unless scope[0] && scope[1] scope end
extract_scope(options)
click to toggle source
# File lib/elasticsearch/client/default_scope.rb, line 22 def extract_scope(options) options = options.dup index = options.delete(:index) || default_index type = options.delete(:type) || default_type [index, type, options] end