my $hidden_copy_statuses;
my $hidden_copy_locations;
my $avail_copy_statuses;
+my $transcendant_sources;
# NOTE calling cstore functions in child_init is dicey because child_init
# may be run before cstore is ready for requests. Use a local init() instead.
$hidden_copy_locations = [map {$_->{id}} @$locs];
+ $transcendant_sources = [
+ map {$_->id} @{$e->search_config_bib_source({transcendant => 't'})}
+ ];
+
return 1;
}
$logger->info("ES holdings filter is " .
OpenSRF::Utils::JSON->perl2JSON($filter));
+ # If we reach this point, we are performing some level of holdings
+ # filtering. Transcendant bib records are considered visible and
+ # available, so allow them to bubble up through the holdings filter.
+ if (@$transcendant_sources) {
+ $filter = {
+ bool => {must => { # 'must' enforce at least one 'should'
+ bool => {should => [
+ {terms => {bib_source => $transcendant_sources}},
+ $filter
+ ]}
+ }}
+ };
+ }
+
# array of filters in progress
push(@{$elastic_query->{query}->{bool}->{filter}}, $filter);
}
# Well-known bib-search index properties
my $BASE_PROPERTIES = {
- source => {type => 'integer', index => 'false'},
- create_date => {type => 'date', index => 'false'},
- edit_date => {type => 'date', index => 'false'},
+ bib_source => {type => 'integer'},
+ create_date => {type => 'date'},
+ edit_date => {type => 'date'},
# Holdings summaries. For bib-search, we don't need
# copy-specific details, only aggregate visibility information.