Sha256: 63b86b701383c604fdb623dba1d78cdf6c76a45acb840a4a6343598c9b288f2f

Contents?: true

Size: 586 Bytes

Versions: 3

Compression:

Stored size: 586 Bytes

Contents

# Generated via
#  `rails generate hyrax:work NewspaperArticle`
class NewspaperArticleIndexer < NewspaperWorks::NewspaperCoreIndexer
  def generate_solr_document
    super.tap do |solr_doc|
      # index the labels for the genre URIs, as searchable and facetable
      article_genre_service = Hyrax::ArticleGenreService.new
      genre_labels = []
      object.genre.each do |value|
        genre_labels << article_genre_service.label(value) { value }
      end
      solr_doc['genre_tesim'] = genre_labels.presence
      solr_doc['genre_sim'] = genre_labels.presence
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
newspaper_works-1.0.1 app/indexers/newspaper_article_indexer.rb
newspaper_works-1.0.0 app/indexers/newspaper_article_indexer.rb
newspaper_works-0.1.0 app/indexers/newspaper_article_indexer.rb