class Sunspot::Search::Group

Attributes

value[R]

Public Instance Methods

data_accessor_for(clazz) click to toggle source
# File lib/sunspot/search/group.rb, line 38
def data_accessor_for(clazz)
  @search.data_accessor_for(clazz)
end
highlights_for(doc) click to toggle source
# File lib/sunspot/search/group.rb, line 30
def highlights_for(doc)
  @search.highlights_for(doc)
end
hits(options = {}) click to toggle source
# File lib/sunspot/search/group.rb, line 14
def hits(options = {})
  if options[:verify]
    super
  else
    @hits ||= super
  end
end
results() click to toggle source
# File lib/sunspot/search/group.rb, line 26
def results
  @results ||= verified_hits.map { |hit| hit.instance }
end
solr_docs() click to toggle source
# File lib/sunspot/search/group.rb, line 34
def solr_docs
  @doclist['docs']
end
total() click to toggle source

The total number of documents matching the query for this group

Returns

Integer

Total matching documents

# File lib/sunspot/search/group.rb, line 49
def total
  @doclist['numFound']
end
verified_hits() click to toggle source
# File lib/sunspot/search/group.rb, line 22
def verified_hits
  @verified_hits ||= super
end

Public Class Methods

new(value, doclist, search) click to toggle source
# File lib/sunspot/search/group.rb, line 10
def initialize(value, doclist, search)
  @value, @doclist, @search = value, doclist, search
end