Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dis-232-Summon-Search-Indexes #2235

Open
wants to merge 4 commits into
base: 25.03.00
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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