Skip to content
Snippets Groups Projects
Commit a9bf9de9 authored by Demian Katz's avatar Demian Katz
Browse files

Added limit_options support to Summon.

parent 60f5a50c
No related merge requests found
......@@ -8,6 +8,15 @@ default_sort = relevance
; should be one of the options present in the [Views] section below.
default_view = list
; This section controls the result limit options for search results. default_limit
; sets the default number of results per page. limit_options is a comma-separated
; list of numbers to be presented to the end-user. If only one limit is required,
; set default_limit and leave limit_options commented out.
; WARNING: using large limits may require you to raise your PHP memory limits to
; avoid errors.
default_limit = 20
;limit_options = 10,20,40,60,80,100
; If this setting is true, boolean operators in searches (AND/OR/NOT) will only
; be recognized if they are ALL UPPERCASE. If set to false, they will be
; recognized regardless of case. If set to a comma-separated list of operators
......
......@@ -79,6 +79,15 @@ class Options extends \VuFind\Search\Base\Options
// Load the search configuration file:
$searchSettings = $configLoader->get($this->searchIni);
// Set up limit preferences
if (isset($searchSettings->General->default_limit)) {
$this->defaultLimit = $searchSettings->General->default_limit;
}
if (isset($searchSettings->General->limit_options)) {
$this->limitOptions
= explode(",", $searchSettings->General->limit_options);
}
// Set up highlighting preference
if (isset($searchSettings->General->highlighting)) {
$this->highlight = $searchSettings->General->highlighting;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment