Skip to content

Commit

Permalink
Merge pull request #181 from AlexanderBlanchardAC/DIS-232-Summon-Sear…
Browse files Browse the repository at this point in the history
…ch-Indexes

Dis 232 summon search indexes
  • Loading branch information
AlexanderBlanchardAC authored Feb 10, 2025
2 parents 5e2c890 + 12910f6 commit c29f05b
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 20 deletions.
2 changes: 2 additions & 0 deletions code/web/release_notes/25.03.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
// james

// alexander
### Summon Updates
- Update the Summon Search Indexes to match those found in Summon Serials Solutions. (DIS-232) (*AB*)

// chloe

Expand Down
144 changes: 124 additions & 20 deletions code/web/sys/SearchObject/SummonSearcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class SearchObject_SummonSearcher extends SearchObject_BaseSearcher{
protected $maxTopics = 1;
protected $groupFilters = array();
protected $openAccessFilter = false;
protected $expand = false;
protected $expand = true;
protected $sortOptions = array();
/**
* @var string
Expand All @@ -73,12 +73,12 @@ class SearchObject_SummonSearcher extends SearchObject_BaseSearcher{
protected $bookMark;
protected $debug = false;
protected $journalTitle = false;
protected $lightWeightRes = false;
protected $lightWeightRes = true;
protected $sort = null;
/**
* @var string mixed
*/
private $searchIndex = 'Title';
private $searchIndex = '';
/**Facets, filters and limiters */
//Values for the main facets - each has an array of available values
protected $facets = [
Expand Down Expand Up @@ -737,21 +737,121 @@ public function getQuerySpeed() {
*/
public function getSearchIndexes() {
return [
"Title" => translate([
'text' => "Title",
'' => translate([
'text' => 'All Fields',
'isPublicFacing' => true,
'inAttribute' => true,
]),
'All Text' => translate([
'text' => "All Text",
'AuthorCombined' => translate([
'text' => 'Author',
'isPublicFacing' => true,
'inAttribute' => true,
]),
'Keyword' => translate([
'text' => "Keyword",
"TitleCombined" => translate([
'text' => 'Title',
'isPublicFacing' => true,
'inAttribute' => true,
])
]),
'PublicationTitle' => translate([
'text' => 'Publication Title',
'isPublicFacing' => true,
'inAttribute' => true,
]),
'SubjectTerms' => translate([
'text' => 'Subject Terms',
'isPublicFacing' => true,
'inAttribute' => true,
]),
'Abstract' => translate([
'text' => 'Abstract',
'isPublicFacing' => true,
'inAttribute' => true,
]),
'CallNumAll' => translate([
'text' => 'Call Number',
'isPublicFacing' => true,
'inAttribute' => true,
]),
'CODEN' => translate([
'text' => 'CODEN',
'isPublicFacing' => true,
'inAttribute' => true,
]),
'DEWEY' => translate([
'text' => 'Dewey',
'isPublicFacing' => true,
'inAttribute' => true,
]),
'DOI' => translate([
'text' => 'DOI',
'isPublicFacing' => true,
'inAttribute' => true,
]),
'IsbnAll' => translate([
'text' => 'ISBN',
'isPublicFacing' => true,
'inAttribute' => true,
]),
'IssnAll' => translate([
'text' => 'ISSN',
'isPublicFacing' => true,
'inAttribute' => true,
]),
'Edition' => translate([
'text' => 'Edition',
'isPublicFacing' => true,
'inAttribute' => true,
]),
'Fulltext' => translate([
'text' => 'Full Text',
'isPublicFacing' => true,
'inAttribute' => true,
]),
'Genre' => translate([
'text' => 'Genre',
'isPublicFacing' => true,
'inAttribute' => true,
]),
'GeographicLocations' => translate([
'text' => 'Geographic Location',
'isPublicFacing' => true,
'inAttribute' => true,
]),
'Issue' => translate([
'text' => 'Issue',
'isPublicFacing' => true,
'inAttribute' => true,
]),
'OCLC' => translate([
'text' => 'OCLC Number',
'isPublicFacing' => true,
'inAttribute' => true,
]),
'PatentNumber' => translate([
'text' => 'Patent Number',
'isPublicFacing' => true,
'inAttribute' => true,
]),
'Publisher' => translate([
'text' => 'Publisher',
'isPublicFacing' => true,
'inAttribute' => true,
]),
'PublicationSeriesTitle' => translate([
'text' => 'Series',
'isPublicFacing' => true,
'inAttribute' => true,
]),
'TemporalSubjectTerms' => translate([
'text' => 'Time Period',
'isPublicFacing' => true,
'inAttribute' => true,
]),
'Volume' => translate([
'text' => 'Volume',
'isPublicFacing' => true,
'inAttribute' => true,
]),
];
}

Expand All @@ -761,18 +861,22 @@ public function getDefaultIndex() {
}

public function setSearchTerm() {
if (strpos($this->searchTerms, ':') !== false) {
[
$searchIndex,
$term,
] = explode(':', $this->searchTerms, 2);
$this->setSearchTerms([
'lookfor' => $term,
'index' => $searchIndex,
]);
if (is_array($this->searchTerms) && count($this->searchTerms) > 0) {
if (strpos($this->searchTerms[0], ':') !== false) {
[$searchIndex, $term] = explode(':', $this->searchTerms[0], 2);
$this->setSearchTerms([
'lookfor' => $term,
'index' => $searchIndex,
]);
} else {
$this->setSearchTerms([
'lookfor' => $this->searchTerms[0],
'index' => $this->getDefaultIndex(),
]);
}
} else {
$this->setSearchTerms([
'lookfor' => $this->searchTerms,
'lookfor' => '',
'index' => $this->getDefaultIndex(),
]);
}
Expand Down

0 comments on commit c29f05b

Please sign in to comment.