Skip to content

Commit

Permalink
Merge pull request #1808 from K-Alette/24.06.00
Browse files Browse the repository at this point in the history
Small Fixes
  • Loading branch information
mdnoble73 committed May 16, 2024
2 parents d91c4ee + fd5b44f commit cca3f96
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 2 deletions.
5 changes: 5 additions & 0 deletions code/web/release_notes/24.06.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
//kirstien

//kodi
### EDS Updates
- Add toggle for defaulting "Full Text" Limiter on/off (Ticket 129247) (*KL*)

### Searching Updates
- Fixed issue where multiselect facets were not allowing multiple values to be selected when searching (Tickets 131841, 131923) (*KL, MDN*)


//other
Expand Down
7 changes: 7 additions & 0 deletions code/web/sys/DBMaintenance/version_updates/24.06.00.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ function getUpdates24_06_00(): array {
//kirstien - ByWater

//kodi - ByWater
'full_text_limiter' => [
'title' => 'Full Text Limiter',
'description' => 'Adds toggle for defaulting the full text limiter on/off for Ebsco EDS.',
'sql' => [
"ALTER TABLE ebsco_eds_settings ADD COLUMN fullTextLimiter TINYINT NOT NULL DEFAULT 1;",
],
], //full_text_limiter

//other

Expand Down
8 changes: 8 additions & 0 deletions code/web/sys/Ebsco/EDSSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class EDSSettings extends DataObject {
public $edsApiUsername;
public $edsApiPassword;
public $edsSearchProfile;
public $fullTextLimiter;

public static function getObjectStructure($context = ''): array {
return [
Expand Down Expand Up @@ -54,6 +55,13 @@ public static function getObjectStructure($context = ''): array {
'description' => 'The password to use when connecting to the EBSCO API',
'hideInLists' => true,
],
'fullTextLimiter' => [
'property' => 'fullTextLimiter',
'type' => 'checkbox',
'label' => 'Full Text Limiter',
'description' => 'Enables/disables the full text limiter being automatically checked.',
'default' => true,
],
];
}
}
9 changes: 8 additions & 1 deletion code/web/sys/SearchObject/EbscoEdsSearcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,10 @@ public function getRecords($ids) {
public function getLimitList() {
global $memCache;
$limitOptions = $memCache->get('ebsco_eds_limit_options_' . $this->getSettings()->edsApiProfile);
$fullText = true;
if (!$this->edsSettings->fullTextLimiter){
$fullText = false;
}
if ($limitOptions === false) {
$searchOptions = $this->getSearchOptions();
$limitOptions = [];
Expand All @@ -801,7 +805,7 @@ public function getLimitList() {
'defaultOn' => false,
];
if ($limit == 'FT') {
$limitOptions[$limit]['defaultOn'] = true;
$limitOptions[$limit]['defaultOn'] = $fullText;
}
}
}
Expand All @@ -814,6 +818,9 @@ public function getLimitList() {
if (array_key_exists($limit, $this->limiters)) {
$limitIsApplied = ($this->limiters[$limit]) == 'y' ? 1 : 0;
} else {
if ($limit == 'FT') {
$limitOption['defaultOn'] = $fullText;
}
$limitIsApplied = $limitOption['defaultOn'];
}
$limitList[$limit] = [
Expand Down
10 changes: 9 additions & 1 deletion code/web/sys/SearchObject/SolrSearcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,15 @@ public function processSearch($returnIndexErrors = false, $recommendations = fal
if (!empty($facetConfig)) {
$facetSet['limit'] = $this->facetLimit;
foreach ($facetConfig as $facetField => $facetInfo) {
$facetSet['field'][$facetField] = $facetInfo;
/* $facetSet['field'][$facetField] = $facetInfo;*/
$facetName = $facetInfo->facetName;
$isMultiSelect = $facetInfo->multiSelect;
if ($isMultiSelect) {
$facetKey = empty($facetInfo->id) ? $facetName : $facetInfo->id;
$facetSet['field'][$facetField] = "{!ex=$facetKey}" . $facetField;
}else{
$facetSet['field'][$facetField] = $facetName;
}
}
if ($this->facetOffset != null) {
$facetSet['offset'] = $this->facetOffset;
Expand Down

0 comments on commit cca3f96

Please sign in to comment.