Sha256: cffcb8f039b3d7b462248b1a448292d412bcd5e385e3297e8eb29f3378e043ea
Contents?: true
Size: 573 Bytes
Versions: 11
Compression:
Stored size: 573 Bytes
Contents
module ActiveFedora module Calculations # Get a count of the number of objects from solr # Takes :conditions as an argument def count(*args) return apply_finder_options(args.first).count if args.any? opts = {} opts[:rows] = limit_value if limit_value opts[:sort] = order_values if order_values calculate :count, where_values, opts end def calculate(_calculation, conditions, _opts = {}) SolrService.query(create_query(conditions), raw: true, rows: 0).fetch('response'.freeze)['numFound'.freeze] end end end
Version data entries
11 entries across 11 versions & 1 rubygems