Closed karenmajewicz closed 4 years ago
Added on GBL GitHub: https://github.com/geoblacklight/geoblacklight/issues/746
Looks like the Samvera folk added DateRangeField support to their solr schema: https://github.com/samvera/hydra-head/commit/da83f62f905a0534f1531c25da3f4b8b3ed00fe6
Some additional information about how it works: https://lucidworks.com/post/solrs-daterangefield-perform/
I have a feature branch working where I've added "b1g_date_range_drsim" to a couple fixtures.
Looks like we could populate that date range field and use it to generate our "Time Period" field. See similar usage example below:
# Example Date Range facet
config.add_facet_field 'date_range_facet_field', label: 'Date Range', :query => {
:years_1 => { label: 'within 1 Year', fq: "b1g_date_range_drsim:[#{Time.zone.now.year} TO *]" },
:years_5 => { label: 'within 5 Years', fq: "b1g_date_range_drsim:[#{Time.zone.now.year - 5 } TO *]" },
:years_10 => { label: 'within 10 Years', fq: "b1g_date_range_drsim:[#{Time.zone.now.year - 10 } TO *]" },
:years_25 => { label: 'within 25 Years', fq: "b1g_date_range_drsim:[#{Time.zone.now.year - 25 } TO *]" }
}
# Existing Year/Time Period query facet
config.add_facet_field 'time_period', :label => 'Time Period', :query => {
'1500s' => { :label => '1500s', :fq => "solr_year_i:[1500 TO 1599]" },
'1600s' => { :label => '1600s', :fq => "solr_year_i:[1600 TO 1699]" },
'1700s' => { :label => '1700s', :fq => "solr_year_i:[1700 TO 1799]" },
'1800-1849' => { :label => '1800-1849', :fq => "solr_year_i:[1800 TO 1849]" },
'1850-1899' => { :label => '1850-1899', :fq => "solr_year_i:[1850 TO 1899]" },
'1900-1949' => { :label => '1900-1949', :fq => "solr_year_i:[1900 TO 1949]" },
'1950-1999' => { :label => '1950-1999', :fq => "solr_year_i:[1950 TO 1999]" },
'2000-2004' => { :label => '2000-2004', :fq => "solr_year_i:[2000 TO 2004]" },
'2005-2009' => { :label => '2005-2009', :fq => "solr_year_i:[2005 TO 2009]" },
'2010-2014' => { :label => '2010-2014', :fq => "solr_year_i:[2010 TO 2014]" },
'2015-present' => { :label => '2015-present', :fq => "solr_year_i:[2015 TO #{Time.now.year}]"}
}, collapse: false
We'll likely want to replace our Blacklight Range Limit plugin with a basic year_start and year_end form that converts the data entered into Date Range Format
Test record here: https://geodev.btaa.org/catalog/05d-09
Add this date range element to all metadata records
Added b1g_date_range_drsim
to all records that had dates on the dev site.
Records representing interactive resources or collections may cover a wide time period. Examples:
Minnesota Historical Aerial Photographs Online (MHAPO), 1920-2000 Wisconsin Historic Aerial Imagery Finder, 1937-1941
Is there a way to index the full temporal range for a single record to enable a user to find these resources using facets or advanced search? If a user tries to limit their search to 1940-1941 using the year limiter, they will not see the Wisconsin record, which gets indexed as 1937. Maybe we need an adjustment to the schema. Here are the affected time related elements from our metadata schema profile:
dct_temporal_sm
Free form text string to represent the "Ground Condition" of the resource, meaning the time period data was collected or is intended to represent. This can be formatted any way that clarifies the time period. Examples: “1910?”, “1800-1805”, “before 2000”.
solr_year_i
This is an integer field in the form YYYY that is used for indexing in the Year & Time Period facets. Use the earliest date in the temporal coverage field. If no date is provided, it will default to 9999, so an estimate is preferred.
Could we somehow change solr_year to be multifaceted?