lib/elasticsearch/model/response.rb in elasticsearch-model-0.1.8 vs lib/elasticsearch/model/response.rb in elasticsearch-model-0.1.9
- old
+ new
@@ -42,12 +42,12 @@
# Returns the collection of records from the database
#
# @return [Records]
#
- def records
- @records ||= Records.new(klass, self)
+ def records(options = {})
+ @records ||= Records.new(klass, self, options)
end
# Returns the "took" time
#
def took
@@ -68,9 +68,15 @@
# Returns a Hashie::Mash of the aggregations
#
def aggregations
response['aggregations'] ? Hashie::Mash.new(response['aggregations']) : nil
+ end
+
+ # Returns a Hashie::Mash of the suggestions
+ #
+ def suggestions
+ Suggestions.new(response['suggest'])
end
end
end
end
end