Class: Sunspot::Search::FieldGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/sunspot/search/field_group.rb

Instance Method Summary collapse

Constructor Details

#initialize(field, search, options) ⇒ FieldGroup

:nodoc:



4
5
6
# File 'lib/sunspot/search/field_group.rb', line 4

def initialize(field, search, options) #:nodoc:
  @field, @search, @options = field, search, options
end

Instance Method Details

#groupsObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/sunspot/search/field_group.rb', line 8

def groups
  @groups ||=
    begin
      if solr_response
        solr_response['groups'].map do |group|
          Group.new(group['groupValue'], group['doclist'], @search)
        end
      end
    end
end

#matchesObject



19
20
21
22
23
# File 'lib/sunspot/search/field_group.rb', line 19

def matches
  if solr_response
    solr_response['matches'].to_i
  end
end