class ProxES::Request::Search

Attributes

index[R]
type[R]

Public Instance Methods

endpoint() click to toggle source
# File lib/proxes/request/search.rb, line 18
def endpoint
  '_search'
end
id() click to toggle source
# File lib/proxes/request/search.rb, line 28
def id
  @id == [] ? nil : @id
end
index=(idx) click to toggle source
# File lib/proxes/request/search.rb, line 11
def index=(idx)
  @index = idx
  self.path_info = '/' + [index, type, id, endpoint].compact
                                                    .map { |v| v.is_a?(Array) ? v.join(',') : v }
                                                    .select { |v| !v.nil? && v != '' }.join('/')
end
indices() click to toggle source
# File lib/proxes/request/search.rb, line 36
def indices
  @index || []
end
indices?() click to toggle source
# File lib/proxes/request/search.rb, line 32
def indices?
  type != ['scroll']
end
parse() click to toggle source
# File lib/proxes/request/search.rb, line 22
def parse
  @index ||= check_part(path_parts[0]) unless path_parts[0] == endpoint
  @type  ||= check_part(path_parts[1]) unless path_parts[1] == endpoint
  @id    ||= check_part(path_parts[2]) unless path_parts[2] == endpoint
end