diff --git a/app/parsers/bulkrax/csv_parser_decorator.rb b/app/parsers/bulkrax/csv_parser_decorator.rb index 9563eda..11c09bc 100644 --- a/app/parsers/bulkrax/csv_parser_decorator.rb +++ b/app/parsers/bulkrax/csv_parser_decorator.rb @@ -7,6 +7,7 @@ module CsvParserDecorator def valid_import? missing_fields_by_model = records.each_with_object({}) do |record, hash| + record.compact! record.transform_keys!(&:downcase).transform_keys!(&:to_sym) missing_fields = missing_fields_for(record) hash[record[:model]] = missing_fields if missing_fields.present? @@ -16,7 +17,7 @@ def valid_import? file_paths.is_a?(Array) rescue StandardError => e - status_info(e) + set_status_info(e) false end diff --git a/config/initializers/bulkrax.rb b/config/initializers/bulkrax.rb index 6270a13..b078193 100644 --- a/config/initializers/bulkrax.rb +++ b/config/initializers/bulkrax.rb @@ -65,7 +65,7 @@ 'audience' => { from: ['audience'], split: '\|' }, 'based_near' => { from: ['location'], split: '\|' }, 'bibliographic_citation' => { from: ['bibliographic_citation'], split: '\|', generated: true }, - 'bulkrax_identifier' => { from: ['source_identifier'], source_identifier: true, generated: true }, + 'bulkrax_identifier' => { from: ['source_identifier'], source_identifier: true, generated: true, search_field: 'bulkrax_identifier_tesim' }, 'children' => { from: ['children'], split: /\s*[;|]\s*/, related_children_field_mapping: true }, 'chronology_note' => { from: ['chronology_note'], split: '\|' }, 'committee_member' => { from: ['committee_member'], split: '\|' }, diff --git a/config/metadata/bulkrax_metadata.yaml b/config/metadata/bulkrax_metadata.yaml deleted file mode 100644 index 61d66e7..0000000 --- a/config/metadata/bulkrax_metadata.yaml +++ /dev/null @@ -1,14 +0,0 @@ -attributes: - bulkrax_identifier: - type: string - predicate: https://hykucommons.org/terms/bulkrax_identifier - multiple: false - index_keys: - # NOTE: For backwards compatibility, we specify `bulkrax_identifier_tesim` - # however if we want singular (which we do) and to have exact match - # (which we do) we don't want to use Text English Stored Indexed - # Multiple (e.g. _tesim suffix). Instead we want String Stored - # Index (e.g. _ssi). However, until we get all of our efforts - # coordinated; we'll continue to contend with this misalignment. - - "bulkrax_identifier_tesim" - - "bulkrax_identifier_ssi"