class Sunspot::NullResult

Constants

VERSION

Attributes

collection[R]
group_by[R]
options[R]

Public Class Methods

new(collection = [], **options) click to toggle source
# File lib/sunspot/null_result.rb, line 13
def initialize(collection = [], **options)
  @collection = collection
  @options    = options
  @group_by   = nil
end

Public Instance Methods

facet(*) click to toggle source
# File lib/sunspot/null_result.rb, line 40
def facet(*)
  Sunspot::NullResult::Facet.new
end
group(group) click to toggle source
# File lib/sunspot/null_result.rb, line 27
def group(group)
  @group_by = group
  self
end
groups() click to toggle source
# File lib/sunspot/null_result.rb, line 32
def groups
  GroupedCollection.new(collection: collection, group_by: group_by, current_page: results.current_page, total_pages: results.total_pages)
end
hits() click to toggle source
# File lib/sunspot/null_result.rb, line 19
def hits
  PaginatedNullArray.new(collection, options)
end
matches() click to toggle source
# File lib/sunspot/null_result.rb, line 36
def matches
  results.size
end
results() click to toggle source
# File lib/sunspot/null_result.rb, line 23
def results
  PaginatedNullArray.new(collection, options)
end
total() click to toggle source
# File lib/sunspot/null_result.rb, line 44
def total
  collection.size
end