def extract_all_marc_values(options = {})
      unless (options.keys - EXTRACT_ALL_MARC_VALID_OPTIONS).empty?
        raise RuntimeError.new("Illegal/Unknown argument '#{(options.keys - EXTRACT_ALL_MARC_VALID_OPTIONS).join(', ')}' in extract_all_marc at #{Traject::Util.extract_caller_location(caller.first)}")
      end
      options = {:from => "100", :to => "899", :separator => ' '}.merge(options)

      if [options[:from], options[:to]].map{|x| x.is_a? String}.any?{|x| x == false}
        raise ArgumentError.new("from/to options to extract_all_marc_values must be strings")
      end

      lambda do |record, accumulator, context|
        record.each do |field|
          next unless field.tag >= options[:from] && field.tag <= options[:to]
          subfield_values = field.subfields.collect {|sf| sf.value}
          next unless subfield_values.length > 0

          if options[:separator]
            accumulator << subfield_values.join( options[:separator])
          else
            accumulator.concat subfield_values
          end
        end
      end

    end
def extract_all_marc_values(options = {})
      unless (options.keys - EXTRACT_ALL_MARC_VALID_OPTIONS).empty?
        raise RuntimeError.new("Illegal/Unknown argument '#{(options.keys - EXTRACT_ALL_MARC_VALID_OPTIONS).join(', ')}' in extract_all_marc at #{Traject::Util.extract_caller_location(caller.first)}")
      end
      options = {:from => "100", :to => "899", :separator => ' '}.merge(options)

      if [options[:from], options[:to]].map{|x| x.is_a? String}.any?{|x| x == false}
        raise ArgumentError.new("from/to options to extract_all_marc_values must be strings")
      end

      lambda do |record, accumulator, context|
        record.each do |field|
          next unless field.tag >= options[:from] && field.tag <= options[:to]
          subfield_values = field.subfields.collect {|sf| sf.value}
          next unless subfield_values.length > 0

          if options[:separator]
            accumulator << subfield_values.join( options[:separator])
          else
            accumulator.concat subfield_values
          end
        end
      end

    end
Takes the whole record, by default from tags 100 to 899 inclusive,
 all subfields, and adds them to output. Subfields in a record are all
 joined by space by default.

 options
 [:from] default '100', only tags >= lexicographically
 [:to]   default '899', only tags <= lexicographically
 [:separator] how to join subfields, default space, nil means don't join

 All fields in from-to must be marc DATA (not control fields), or weirdness

 Can always run this thing multiple times on the same field if you need
 non-contiguous ranges of fields.