Sha256: 7638c008db23bd87dd2e712b7382df85576a04573af7169d6188871eae99e1d1

Contents?: true

Size: 901 Bytes

Versions: 15

Compression:

Stored size: 901 Bytes

Contents

module Hyrax
  module Stats
    class WorkStatusSearchBuilder < ::SearchBuilder
      self.default_processor_chain = [:include_suppressed_facet]
      # includes the suppressed facet to get information on deposits.
      # use caution when combining this with other searches as it sets the rows to
      # zero to just get the facet information
      # @param solr_parameters the current solr parameters
      def include_suppressed_facet(solr_parameters)
        solr_parameters[:"facet.field"].concat([IndexesWorkflow.suppressed_field])
        solr_parameters[:'facet.missing'] = true
        # only get work information
        solr_parameters[:fq] = work_relation.search_model_clause

        # we only want the facet counts not the actual data
        solr_parameters[:rows] = 0
      end

      private

        def work_relation
          Hyrax::WorkRelation.new
        end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
hyrax-1.1.1 app/search_builders/hyrax/stats/work_status_search_builder.rb
hyrax-1.1.0 app/search_builders/hyrax/stats/work_status_search_builder.rb
hyrax-2.0.0.rc1 app/search_builders/hyrax/stats/work_status_search_builder.rb
hyrax-1.0.5 app/search_builders/hyrax/stats/work_status_search_builder.rb
hyrax-2.0.0.beta5 app/search_builders/hyrax/stats/work_status_search_builder.rb
hyrax-2.0.0.beta4 app/search_builders/hyrax/stats/work_status_search_builder.rb
hyrax-2.0.0.beta3 app/search_builders/hyrax/stats/work_status_search_builder.rb
hyrax-2.0.0.beta2 app/search_builders/hyrax/stats/work_status_search_builder.rb
hyrax-2.0.0.beta1 app/search_builders/hyrax/stats/work_status_search_builder.rb
hyrax-1.0.4 app/search_builders/hyrax/stats/work_status_search_builder.rb
hyrax-1.0.3 app/search_builders/hyrax/stats/work_status_search_builder.rb
hyrax-1.0.2 app/search_builders/hyrax/stats/work_status_search_builder.rb
hyrax-1.0.1 app/search_builders/hyrax/stats/work_status_search_builder.rb
hyrax-1.0.0.rc2 app/search_builders/hyrax/stats/work_status_search_builder.rb
hyrax-1.0.0.rc1 app/search_builders/hyrax/stats/work_status_search_builder.rb