lib/psulib_traject/macros/subjects.rb
def process_subject_topic_facet(fields)
    lambda do |record, accumulator|
      return unless record.is_a? MARC::Record

      subjects = []
      Traject::MarcExtractor.cached(fields).collect_matching_lines(record) do |field, spec, extractor|
        subjects << extract_subjects(field, spec, extractor)
      end

      accumulator.replace(subjects.flatten.compact.uniq)
    end
  end
# For the split subject facet
#
# Split with em dash along v,x,y,z
For the split subject facet
Split with em dash along v,x,y,z
For the split subject facet Split with em dash along v x y z
def process_subject_topic_facet(fields)
    lambda do |record, accumulator|
      return unless record.is_a? MARC::Record
      subjects = []
      Traject::MarcExtractor.cached(fields).collect_matching_lines(record) do |field, spec, extractor|
        subjects << extract_subjects(field, spec, extractor)
      end
      accumulator.replace(subjects.flatten.compact.uniq)
    end
  end
def process_subject_topic_facet ( fields ) lambda do | record , accumulator | return unless record . is_a? MARC :: Record subjects = [ ] Traject :: MarcExtractor . cached ( fields ) . collect_matching_lines ( record ) do | field , spec , extractor | subjects << extract_subjects ( field , spec , extractor ) end accumulator . replace ( subjects . flatten . compact . uniq ) end end
For the split subject facet
Split with em dash along v,x,y,z
For the split subject facet Split with em dash along v x y z
fields