From bd14bbe3168bb19e6c0457c5c8a7faec6d141cce Mon Sep 17 00:00:00 2001 From: Huda Khan Date: Mon, 18 Nov 2024 13:31:34 -0700 Subject: [PATCH 1/4] parker only index fields --- app/controllers/catalog_controller.rb | 16 +++++++++++----- config/settings.yml | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index 7defe68d3..259a75c3f 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -267,15 +267,23 @@ class CatalogController < ApplicationController config.add_index_field 'format_main_ssim', label: 'Resource type', if: lambda { |context, *_args| context.feature_flags.add_resource_type_index_field? } + + # Parker specific fields (via Solr) + # editor_ssim, university_ssim, range_labels_ssim, and related_document_id_ssim. + config.add_index_field 'book_title_ssim', if: lambda { |context, *_args| + context.feature_flags.add_parker_index_fields? + } + config.add_index_field 'university_ssim', label: 'University' + config.add_index_field 'edition_ssm', label: 'Edition' + config.add_index_field 'range_labels_tesim', label: 'Section' + config.add_index_field 'related_document_id_ssim', label: 'Manuscript', helper_method: :manuscript_link + # Fields added by Zotero API BibTeX import config.add_index_field 'volume_ssm', label: 'Volume' config.add_index_field 'pages_ssm', label: 'Pages' config.add_index_field 'doi_ssim', label: 'DOI' config.add_index_field 'issue_ssm', label: 'Issue' - config.add_index_field 'edition_ssm', label: 'Edition' - config.add_index_field 'university_ssim', label: 'University' config.add_index_field 'thesis_type_ssm', label: 'Degree Type' - config.add_index_field 'book_title_ssim', label: 'Book Title' config.add_index_field 'ref_type_ssm', label: 'Reference Type' # This was added for the Feigbenbaum exhibit. It includes any general from # the MODs that do not have attributes. It is used for display and is not facetable. @@ -287,8 +295,6 @@ class CatalogController < ApplicationController config.add_index_field 'incipit_tesim', label: 'Incipit' config.add_index_field 'toc_search', label: 'Table of contents', helper_method: :table_of_contents_separator config.add_index_field 'manuscript_number_tesim', label: 'Manuscript number' - config.add_index_field 'range_labels_tesim', label: 'Section' - config.add_index_field 'related_document_id_ssim', label: 'Manuscript', helper_method: :manuscript_link config.add_index_field( 'full_text_tesimv', immutable: (config.view.keys - [:list]).push(:show).map { |k| [k, false] }.to_h, diff --git a/config/settings.yml b/config/settings.yml index afc8ef829..ec17c7237 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -23,6 +23,7 @@ feature_flags: index_related_content: false # A feature that will index related SDR content. Initial implemented for Parker's IIIF AnnotationLists add_resource_type_index_field: false # Should the resource type field be added as an index/show field. For some exhibits this is desirable add_parker_search_fields: false # Parker specific search fields + add_parker_index_fields: false # Parker specific index fields slack_notifications: false uat_embed: false search_across: false From b3c309ea89b16e813ee2788fda084163bf2e8379 Mon Sep 17 00:00:00 2001 From: Huda Khan Date: Tue, 19 Nov 2024 15:09:24 -0700 Subject: [PATCH 2/4] configuring parker only fields for index view --- app/controllers/catalog_controller.rb | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index 259a75c3f..6e0480efc 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -273,10 +273,18 @@ class CatalogController < ApplicationController config.add_index_field 'book_title_ssim', if: lambda { |context, *_args| context.feature_flags.add_parker_index_fields? } - config.add_index_field 'university_ssim', label: 'University' - config.add_index_field 'edition_ssm', label: 'Edition' - config.add_index_field 'range_labels_tesim', label: 'Section' - config.add_index_field 'related_document_id_ssim', label: 'Manuscript', helper_method: :manuscript_link + config.add_index_field 'university_ssim', label: 'University', if: lambda { |context, *_args| + context.feature_flags.add_parker_index_fields? + } + config.add_index_field 'edition_ssm', label: 'Edition', if: lambda { |context, *_args| + context.feature_flags.add_parker_index_fields? + } + config.add_index_field 'range_labels_tesim', label: 'Section', if: lambda { |context, *_args| + context.feature_flags.add_parker_index_fields? + } + config.add_index_field 'related_document_id_ssim', label: 'Manuscript', helper_method: :manuscript_link, if: lambda { |context, *_args| + context.feature_flags.add_parker_index_fields? + } # Fields added by Zotero API BibTeX import config.add_index_field 'volume_ssm', label: 'Volume' From 01977ee1d4d3ed7f2a791a0dd8328e5dd158dc72 Mon Sep 17 00:00:00 2001 From: Huda Khan Date: Tue, 19 Nov 2024 15:10:48 -0700 Subject: [PATCH 3/4] updating comment --- app/controllers/catalog_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index 6e0480efc..839d4b13a 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -268,7 +268,7 @@ class CatalogController < ApplicationController context.feature_flags.add_resource_type_index_field? } - # Parker specific fields (via Solr) + # Parker specific fields we do not wish to show in other exhibits # editor_ssim, university_ssim, range_labels_ssim, and related_document_id_ssim. config.add_index_field 'book_title_ssim', if: lambda { |context, *_args| context.feature_flags.add_parker_index_fields? From b4d67ecaef0d8f3124d945d53e1c7359f7a6b416 Mon Sep 17 00:00:00 2001 From: Huda Khan Date: Tue, 19 Nov 2024 16:08:20 -0700 Subject: [PATCH 4/4] indentation --- app/controllers/catalog_controller.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index 839d4b13a..85fc62267 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -282,9 +282,10 @@ class CatalogController < ApplicationController config.add_index_field 'range_labels_tesim', label: 'Section', if: lambda { |context, *_args| context.feature_flags.add_parker_index_fields? } - config.add_index_field 'related_document_id_ssim', label: 'Manuscript', helper_method: :manuscript_link, if: lambda { |context, *_args| - context.feature_flags.add_parker_index_fields? - } + config.add_index_field 'related_document_id_ssim', label: 'Manuscript', helper_method: :manuscript_link, + if: lambda { |context, *_args| + context.feature_flags.add_parker_index_fields? + } # Fields added by Zotero API BibTeX import config.add_index_field 'volume_ssm', label: 'Volume'