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

Add option to configure solr backend default field list #1568

Merged
merged 6 commits into from
Mar 5, 2020
Merged
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
1 change: 1 addition & 0 deletions config/vufind/Search2.ini
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ retain_filters_by_default = true
;default_filters[] = "format:Book"
;default_filters[] = "institution:MyInstitution"
;default_filters[] = "(format:Book AND institution:MyInstitution)"
;default_record_fields = "*,score"

[Cache]
type = File
Expand Down
1 change: 1 addition & 0 deletions config/vufind/authority.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ default_handler = AllFields ; Search handler to use if none is specified
default_sort = relevance
case_sensitive_bools = true
default_side_recommend[] = SideFacets:Facets:CheckboxFacets:authority
;default_record_fields = "*,score"

[Basic_Searches]
AllFields = "All Fields"
Expand Down
1 change: 1 addition & 0 deletions config/vufind/reserves.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ default_sort = relevance
case_sensitive_bools = true
default_side_recommend[] = SideFacets:Facets:CheckboxFacets:reserves
facet_limit = 20
;default_record_fields = "*,score"

[Basic_Searches]
AllFields = "All Fields"
Expand Down
5 changes: 5 additions & 0 deletions config/vufind/searches.ini
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ retain_filters_by_default = true
;default_filters[] = "institution:MyInstitution"
;default_filters[] = "(format:Book AND institution:MyInstitution)"

; Default record fields to fetch from Solr when searching (Solr parameter 'fl')
; Default is "*" (since VuFind 7.0). To restore previous setting, just uncomment
; line below.
;default_record_fields = "*,score"

[Cache]
; This controls whether the parsed searchspecs.yaml file will be stored to
; improve search performance; legal options are APC (use APC cache), File (store
Expand Down
1 change: 1 addition & 0 deletions config/vufind/website.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ default_side_recommend[] = CatalogResults
highlighting = true
snippets = true
retain_filters_by_default = true
;default_record_fields = "*,score"

[Basic_Searches]
AllFields = "All Fields"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,13 @@ protected function getHiddenFilters()
protected function createConnector()
{
$config = $this->config->get($this->mainConfig);
$searchConfig = $this->config->get($this->searchConfig);
$defaultFields = $searchConfig->General->default_record_fields ?? '*';

$handlers = [
'select' => [
'fallback' => true,
'defaults' => ['fl' => '*,score'],
'defaults' => ['fl' => $defaultFields],
'appends' => ['fq' => []],
],
'terms' => [
Expand Down