Params
extends Params
in package
Pazpar2 Search Parameters
Tags
Table of Contents
- $checkboxFacets : array<string|int, mixed>
- Checkbox facet configuration
- $configLoader : PluginManager
- Config loader
- $defaultFacetLabelCheckboxSections : array<string|int, mixed>
- Config sections to search for checkbox facet labels if no override configuration is set.
- $defaultFacetLabelSections : array<string|int, mixed>
- Config sections to search for facet labels if no override configuration is set.
- $defaultsApplied : bool
- Are default filters applied?
- $extraFacetLabels : array<string|int, mixed>
- Extra facet labels
- $facetAliases : array<string|int, mixed>
- Map of facet field aliases.
- $facetConfig : array<string|int, mixed>
- Main facet configuration
- $filterList : array<string|int, mixed>
- Applied filters
- $hiddenFilters : array<string|int, mixed>
- Pre-assigned filters
- $lastView : string
- Previously-used view (loaded in from session)
- $limit : int
- Result limit
- $options : Options
- Search options
- $orFacets : array<string|int, mixed>
- Facets in "OR" mode
- $overrideQuery : mixed
- Override Query
- $page : int
- Page number
- $query : Query
- Internal representation of user query.
- $queryAdapter : QueryAdapterInterface|null
- Query adapter
- $queryAdapterClass : string
- Default query adapter class
- $searchContextParameters : array<string|int, mixed>
- Search context parameters.
- $searchType : string
- Search type (basic or advanced)
- $selectedShards : array<string|int, mixed>
- Shards
- $skipRssSort : bool
- Override special RSS sort feature?
- $sort : string
- Sort setting
- $view : string
- View
- __clone() : void
- Copy constructor
- __construct() : mixed
- Constructor
- addCheckboxFacet() : void
- Add a checkbox facet. When the checkbox is checked, the specified filter will be applied to the search. When the checkbox is not checked, no filter will be applied.
- addFacet() : void
- Add a field to facet on.
- addFilter() : void
- Take a filter string and add it into the protected array checking for duplicates.
- addHiddenFilter() : void
- Take a filter string and add it into the protected hidden filters array checking for duplicates.
- addHiddenFilterForField() : void
- Take a filter string and add it into the protected hidden filters array checking for duplicates.
- convertToAdvancedSearch() : void
- Convert a basic query into an advanced query:
- deminify() : void
- Restore settings from a minified object found in the database.
- getAliasesForFacetField() : array<string|int, mixed>
- Given a facet field, return an array containing all aliases of that field.
- getBackendParameters() : ParamBag
- Create search backend parameters for advanced features.
- getCheckboxFacets() : array<string|int, mixed>
- Get information on the current state of the boolean checkbox facets.
- getDefaultSort() : string
- Return the default sorting value
- getDisplayQuery() : string
- Build a string for onscreen display showing the query used in the search (not the filters).
- getDisplayQueryWithReplacedTerm() : string
- Return a query string for the current search with a search term replaced.
- getFacetConfig() : array<string|int, mixed>
- Get the current facet configuration.
- getFacetLabel() : string
- Get a user-friendly string to describe the provided facet field.
- getFacetOperator() : string
- Get facet operator for the specified field
- getFacetValueRawDisplayText() : string
- Get a display text for a facet field.
- getFilterList() : array<string|int, mixed>
- Return an array structure containing information about all current filters.
- getFiltersAsQueryParams() : array<string|int, mixed>
- Get the filter list as a query parameter array.
- getHiddenFilters() : array<string|int, mixed>
- Get hidden filters grouped by field like normal filters.
- getHiddenFiltersAsQueryParams() : array<string|int, mixed>
- Get the hidden filter list as a query parameter array.
- getLimit() : int
- Return the current limit value
- getLimitList() : array<string|int, mixed>
- Return a list of urls for possible limits, along with which option should be currently selected.
- getOptions() : Options
- Get the search options object.
- getOverrideQuery() : string
- Get the override query
- getPage() : int
- Get the page value
- getQuery() : AbstractQuery
- Return search query object.
- getQueryAdapter() : QueryAdapterInterface
- Get query adapter
- getQueryIDLimit() : int
- Get the maximum number of IDs that may be sent to setQueryIDs (-1 for no limit).
- getRawFilters() : array<string|int, mixed>
- Get the raw filter list.
- getSavedSearchContextParameters() : array<string|int, mixed>
- Get remembered search context parameters from saved search. We track these separately since in some contexts we want to use them (e.g. linking back to a search in breadcrumbs), but in other contexts we want to ignore them (e.g. comparing two searches to see if they represent the same query -- because page 1 and page 2 still represent the same overall search).
- getSearchClassId() : string
- Get the identifier used for naming the various search classes in this family.
- getSearchHandler() : string|null
- Return the selected search handler (null for complex searches which have no single handler)
- getSearchType() : string
- Return the search type (i.e. basic or advanced)
- getSelectedShards() : array<string|int, mixed>
- Get an array of the names of all selected shards. These should correspond with keys in the array returned by the option class's getShards() method.
- getSort() : string
- Return the sorting value
- getSortList() : array<string|int, mixed>
- Return a list of urls for sorting, along with which option should be currently selected.
- getView() : string
- Return the value for which search view we use
- getViewList() : array<string|int, mixed>
- Basic 'getter' for list of available view options.
- hasDefaultsApplied() : bool
- Are default filters applied?
- hasFilter() : bool
- Does the object already contain the specified filter?
- hasHiddenFilter() : bool
- Does the object already contain the specified hidden filter?
- initFromRequest() : void
- Pull the search parameters
- isAdvancedFilter() : bool
- Detects if a filter is advanced (true) or simple (false). An advanced filter is currently defined as one surrounded by parentheses (possibly with a leading exclusion operator), while a simple filter is of the form field:value. Advanced filters are used to express more complex queries, such as combining multiple values from multiple fields using boolean operators.
- minify() : void
- Store settings to a minified object
- parseFilter() : array<string|int, mixed>
- Parse apart the field and value from a URL filter string.
- parseFilterAndPrefix() : array<string|int, mixed>
- Parse apart any prefix, field and value from a URL filter string.
- removeAllFilters() : void
- Remove all filters from the list.
- removeFilter() : void
- Remove a filter from the list.
- resetFacetConfig() : void
- Reset the current facet configuration.
- setBasicSearch() : void
- Set a basic search query:
- setLastView() : void
- Set the last value of the view parameter (if available in session).
- setLimit() : void
- Change the value of the limit
- setOptions() : void
- Set the search options object.
- setOverrideQuery() : void
- Set the override query
- setPage() : void
- Change the page
- setQuery() : void
- Set search query object.
- setQueryAdapter() : void
- Set query adapter
- setQueryIDs() : void
- Override the normal search behavior with an explicit array of IDs that must be retrieved.
- setSort() : void
- Set the sorting value (note: sort will be set to default if an illegal or empty value is passed in).
- setView() : void
- Set the value for which search view we use
- supportsFacetFiltering() : bool
- Check whether a specific facet supports filtering
- translate() : string
- Translate a string (or string-castable object)
- translateFacetValue() : string
- Translate a facet value.
- buildDateRangeFilter() : string
- Support method for initDateFilters() -- build a filter query based on a range of 4-digit years.
- buildFullDateRangeFilter() : string
- Support method for initFullDateFilters() -- build a filter query based on a range of dates.
- buildGenericRangeFilter() : string
- Support method for initGenericRangeFilters() -- build a filter query based on a range of values.
- buildNumericRangeFilter() : string
- Support method for initNumericRangeFilters() -- build a filter query based on a range of numbers.
- formatDateForFullDateRange() : string
- Support method for initFullDateFilters() -- normalize a date for use in a year/month/day date range.
- formatFilterArrayAsQueryParams() : array<string|int, mixed>
- Format a raw filter array as a query parameter array.
- formatFilterListEntry() : array<string|int, mixed>
- Format a single filter for use in getFilterList().
- formatValueForNumericRange() : string
- Support method for initNumericRangeFilters() -- normalize a number for use in a numeric range.
- formatYearForDateRange() : string
- Support method for initDateFilters() -- normalize a year for use in a year-based date range.
- getCheckboxFacetValues() : array<string|int, mixed>
- Get a formatted list of checkbox filter values ($field => array of values).
- getRawCheckboxFacets() : array<string|int, mixed>
- Return checkbox facets without any processing
- initAdvancedSearch() : void
- Support method for initSearch() -- handle advanced settings. Advanced searches have numeric subscripts on the lookfor and type parameters -- this is how they are distinguished from basic searches.
- initBasicSearch() : bool
- Support method for initSearch() -- handle basic settings.
- initCheckboxFacets() : bool
- Initialize checkbox facet settings for the specified configuration sections.
- initDateFilters() : void
- Support method for initFilters() -- initialize year-based date filters.
- initFacetList() : bool
- Initialize facet settings for the specified configuration sections.
- initFilters() : void
- Add filters to the object based on values found in the request object.
- initFullDateFilters() : void
- Support method for initFilters() -- initialize year/month/day-based date filters. Factored out as a separate method so that it can be more easily overridden by child classes.
- initGenericRangeFilters() : void
- Support method for initFilters() -- initialize range filters. Factored out as a separate method so that it can be more easily overridden by child classes.
- initHiddenFilters() : void
- Add hidden filters to the object based on values found in the request object.
- initLimit() : void
- Pull the page size parameter or set to default
- initNumericRangeFilters() : void
- Support method for initFilters() -- initialize numeric range filters. Factored out as a separate method so that it can be more easily overridden by child classes.
- initPage() : void
- Pull the page parameter
- initRangeFilters() : void
- Initialize all range filters.
- initSearch() : void
- Initialize the object's search settings from a request object.
- initShards() : void
- Pull shard parameters from the request or set defaults
- initSort() : void
- Get the value for which type of sorting to use
- initView() : void
- Get the value for which results view to use
- parseOperatorAndFieldName() : array<string|int, mixed>
- Parse the operator and field name from a prefixed field string.
Properties
$checkboxFacets
Checkbox facet configuration
protected
array<string|int, mixed>
$checkboxFacets
= []
$configLoader
Config loader
protected
PluginManager
$configLoader
$defaultFacetLabelCheckboxSections
Config sections to search for checkbox facet labels if no override configuration is set.
protected
array<string|int, mixed>
$defaultFacetLabelCheckboxSections
= []
$defaultFacetLabelSections
Config sections to search for facet labels if no override configuration is set.
protected
array<string|int, mixed>
$defaultFacetLabelSections
= ['ExtraFacetLabels']
$defaultsApplied
Are default filters applied?
protected
bool
$defaultsApplied
= false
$extraFacetLabels
Extra facet labels
protected
array<string|int, mixed>
$extraFacetLabels
= []
$facetAliases
Map of facet field aliases.
protected
array<string|int, mixed>
$facetAliases
= []
$facetConfig
Main facet configuration
protected
array<string|int, mixed>
$facetConfig
= []
$filterList
Applied filters
protected
array<string|int, mixed>
$filterList
= []
$hiddenFilters
Pre-assigned filters
protected
array<string|int, mixed>
$hiddenFilters
= []
$lastView
Previously-used view (loaded in from session)
protected
string
$lastView
= null
$limit
Result limit
protected
int
$limit
= 20
$options
Search options
protected
Options
$options
$orFacets
Facets in "OR" mode
protected
array<string|int, mixed>
$orFacets
= []
$overrideQuery
Override Query
protected
mixed
$overrideQuery
= false
$page
Page number
protected
int
$page
= 1
$query
Internal representation of user query.
protected
Query
$query
$queryAdapter
Query adapter
protected
QueryAdapterInterface|null
$queryAdapter
= null
$queryAdapterClass
Default query adapter class
protected
string
$queryAdapterClass
= \VuFind\Search\QueryAdapter::class
$searchContextParameters
Search context parameters.
protected
array<string|int, mixed>
$searchContextParameters
= []
$searchType
Search type (basic or advanced)
protected
string
$searchType
= 'basic'
$selectedShards
Shards
protected
array<string|int, mixed>
$selectedShards
= []
$skipRssSort
Override special RSS sort feature?
protected
bool
$skipRssSort
= false
$sort
Sort setting
protected
string
$sort
= null
$view
View
protected
string
$view
= null
Methods
__clone()
Copy constructor
public
__clone() : void
Return values
void —__construct()
Constructor
public
__construct(Options $options, PluginManager $configLoader) : mixed
Parameters
- $options : Options
-
Options to use
- $configLoader : PluginManager
-
Config loader
Return values
mixed —addCheckboxFacet()
Add a checkbox facet. When the checkbox is checked, the specified filter will be applied to the search. When the checkbox is not checked, no filter will be applied.
public
addCheckboxFacet(string $filter, string $desc[, bool $dynamic = false ]) : void
Parameters
- $filter : string
-
[field]:[value] pair to associate with checkbox
- $desc : string
-
Description to associate with the checkbox
- $dynamic : bool = false
-
Is this being added dynamically (true) or in response to a user configuration (false)?
Return values
void —addFacet()
Add a field to facet on.
public
addFacet(string $newField[, string $newAlias = null ][, bool $ored = false ]) : void
Parameters
- $newField : string
-
Field name
- $newAlias : string = null
-
Optional on-screen display label
- $ored : bool = false
-
Should we treat this as an ORed facet?
Return values
void —addFilter()
Take a filter string and add it into the protected array checking for duplicates.
public
addFilter(string $newFilter) : void
Parameters
- $newFilter : string
-
A filter string from url : "field:value"
Return values
void —addHiddenFilter()
Take a filter string and add it into the protected hidden filters array checking for duplicates.
public
addHiddenFilter(string $newFilter) : void
Parameters
- $newFilter : string
-
A filter string from url : "field:value"
Return values
void —addHiddenFilterForField()
Take a filter string and add it into the protected hidden filters array checking for duplicates.
public
addHiddenFilterForField(string $field, string $value) : void
Parameters
- $field : string
-
Field
- $value : string
-
Filter value
Return values
void —convertToAdvancedSearch()
Convert a basic query into an advanced query:
public
convertToAdvancedSearch() : void
Return values
void —deminify()
Restore settings from a minified object found in the database.
public
deminify(Minified $minified) : void
Parameters
- $minified : Minified
-
Minified Search Object
Return values
void —getAliasesForFacetField()
Given a facet field, return an array containing all aliases of that field.
public
getAliasesForFacetField(string $field) : array<string|int, mixed>
Parameters
- $field : string
-
Field to look up
Return values
array<string|int, mixed> —getBackendParameters()
Create search backend parameters for advanced features.
public
getBackendParameters() : ParamBag
Return values
ParamBag —getCheckboxFacets()
Get information on the current state of the boolean checkbox facets.
public
getCheckboxFacets([array<string|int, mixed> $include = null ][, bool $includeDynamic = true ]) : array<string|int, mixed>
Parameters
- $include : array<string|int, mixed> = null
-
List of checkbox filters to return (null for all)
- $includeDynamic : bool = true
-
Should we include dynamically-generated checkboxes that are not part of the include list above?
Return values
array<string|int, mixed> —getDefaultSort()
Return the default sorting value
public
getDefaultSort() : string
Return values
string —getDisplayQuery()
Build a string for onscreen display showing the query used in the search (not the filters).
public
getDisplayQuery() : string
Return values
string —user friendly version of 'query'
getDisplayQueryWithReplacedTerm()
Return a query string for the current search with a search term replaced.
public
getDisplayQueryWithReplacedTerm(string $oldTerm, string $newTerm) : string
Parameters
- $oldTerm : string
-
The old term to replace
- $newTerm : string
-
The new term to search
Return values
string —query string
getFacetConfig()
Get the current facet configuration.
public
getFacetConfig() : array<string|int, mixed>
Return values
array<string|int, mixed> —getFacetLabel()
Get a user-friendly string to describe the provided facet field.
public
getFacetLabel(string $field[, string $value = null ][, string $default = null ]) : string
Parameters
- $field : string
-
Facet field name.
- $value : string = null
-
Facet value.
- $default : string = null
-
Default field name (null for default behavior).
Return values
string —Human-readable description of field.
getFacetOperator()
Get facet operator for the specified field
public
getFacetOperator(string $field) : string
Parameters
- $field : string
-
Field name
Return values
string —getFacetValueRawDisplayText()
Get a display text for a facet field.
public
getFacetValueRawDisplayText(string $field, string $value) : string
Parameters
- $field : string
-
Facet field
- $value : string
-
Facet value
Return values
string —getFilterList()
Return an array structure containing information about all current filters.
public
getFilterList([bool $excludeCheckboxFilters = false ]) : array<string|int, mixed>
Parameters
- $excludeCheckboxFilters : bool = false
-
Should we exclude checkbox filters from the list (to be used as a complement to getCheckboxFacets()).
Return values
array<string|int, mixed> —Field, values and translation status
getFiltersAsQueryParams()
Get the filter list as a query parameter array.
public
getFiltersAsQueryParams() : array<string|int, mixed>
Returns an array of strings that parseFilter can parse.
Return values
array<string|int, mixed> —getHiddenFilters()
Get hidden filters grouped by field like normal filters.
public
getHiddenFilters() : array<string|int, mixed>
Return values
array<string|int, mixed> —getHiddenFiltersAsQueryParams()
Get the hidden filter list as a query parameter array.
public
getHiddenFiltersAsQueryParams() : array<string|int, mixed>
Returns an array of strings that parseFilter can parse.
Return values
array<string|int, mixed> —getLimit()
Return the current limit value
public
getLimit() : int
Return values
int —getLimitList()
Return a list of urls for possible limits, along with which option should be currently selected.
public
getLimitList() : array<string|int, mixed>
Return values
array<string|int, mixed> —Limit urls, descriptions and selected flags
getOptions()
Get the search options object.
public
getOptions() : Options
Return values
Options —getOverrideQuery()
Get the override query
public
getOverrideQuery() : string
Return values
string —getPage()
Get the page value
public
getPage() : int
Return values
int —getQuery()
Return search query object.
public
getQuery() : AbstractQuery
Return values
AbstractQuery —getQueryAdapter()
Get query adapter
public
getQueryAdapter() : QueryAdapterInterface
Return values
QueryAdapterInterface —getQueryIDLimit()
Get the maximum number of IDs that may be sent to setQueryIDs (-1 for no limit).
public
getQueryIDLimit() : int
Return values
int —getRawFilters()
Get the raw filter list.
public
getRawFilters() : array<string|int, mixed>
Return values
array<string|int, mixed> —getSavedSearchContextParameters()
Get remembered search context parameters from saved search. We track these separately since in some contexts we want to use them (e.g. linking back to a search in breadcrumbs), but in other contexts we want to ignore them (e.g. comparing two searches to see if they represent the same query -- because page 1 and page 2 still represent the same overall search).
public
getSavedSearchContextParameters() : array<string|int, mixed>
Return values
array<string|int, mixed> —getSearchClassId()
Get the identifier used for naming the various search classes in this family.
public
getSearchClassId() : string
Return values
string —getSearchHandler()
Return the selected search handler (null for complex searches which have no single handler)
public
getSearchHandler() : string|null
Return values
string|null —getSearchType()
Return the search type (i.e. basic or advanced)
public
getSearchType() : string
Return values
string —getSelectedShards()
Get an array of the names of all selected shards. These should correspond with keys in the array returned by the option class's getShards() method.
public
getSelectedShards() : array<string|int, mixed>
Return values
array<string|int, mixed> —getSort()
Return the sorting value
public
getSort() : string
Return values
string —getSortList()
Return a list of urls for sorting, along with which option should be currently selected.
public
getSortList() : array<string|int, mixed>
Return values
array<string|int, mixed> —Sort urls, descriptions and selected flags
getView()
Return the value for which search view we use
public
getView() : string
Return values
string —getViewList()
Basic 'getter' for list of available view options.
public
getViewList() : array<string|int, mixed>
Return values
array<string|int, mixed> —hasDefaultsApplied()
Are default filters applied?
public
hasDefaultsApplied() : bool
Return values
bool —hasFilter()
Does the object already contain the specified filter?
public
hasFilter(string $filter) : bool
Parameters
- $filter : string
-
A filter string from url : "field:value"
Return values
bool —hasHiddenFilter()
Does the object already contain the specified hidden filter?
public
hasHiddenFilter(string $filter) : bool
Parameters
- $filter : string
-
A filter string from url : "field:value"
Return values
bool —initFromRequest()
Pull the search parameters
public
initFromRequest(Parameters $request) : void
Parameters
- $request : Parameters
-
Parameter object representing user request.
Return values
void —isAdvancedFilter()
Detects if a filter is advanced (true) or simple (false). An advanced filter is currently defined as one surrounded by parentheses (possibly with a leading exclusion operator), while a simple filter is of the form field:value. Advanced filters are used to express more complex queries, such as combining multiple values from multiple fields using boolean operators.
public
isAdvancedFilter(string $filter) : bool
Parameters
- $filter : string
-
A filter string
Return values
bool —minify()
Store settings to a minified object
public
minify(Minified &$minified) : void
Parameters
- $minified : Minified
-
Minified Search Object
Return values
void —parseFilter()
Parse apart the field and value from a URL filter string.
public
parseFilter(string $filter) : array<string|int, mixed>
Parameters
- $filter : string
-
A filter string from url : "field:value"
Return values
array<string|int, mixed> —Array with elements 0 = field, 1 = value.
parseFilterAndPrefix()
Parse apart any prefix, field and value from a URL filter string.
public
parseFilterAndPrefix(string $filter) : array<string|int, mixed>
Parameters
- $filter : string
-
A filter string from url : "field:value"
Return values
array<string|int, mixed> —Array with elements 0 = prefix, 1 = field, 2 = value.
removeAllFilters()
Remove all filters from the list.
public
removeAllFilters([string $field = null ]) : void
Parameters
- $field : string = null
-
Name of field to remove filters from (null to remove all filters from all fields)
Return values
void —removeFilter()
Remove a filter from the list.
public
removeFilter(string $oldFilter) : void
Parameters
- $oldFilter : string
-
A filter string from url : "field:value"
Return values
void —resetFacetConfig()
Reset the current facet configuration.
public
resetFacetConfig() : void
Return values
void —setBasicSearch()
Set a basic search query:
public
setBasicSearch(string $lookfor[, string $handler = null ]) : void
Parameters
- $lookfor : string
-
The search query
- $handler : string = null
-
The search handler (null for default)
Return values
void —setLastView()
Set the last value of the view parameter (if available in session).
public
setLastView(string $view) : void
Parameters
- $view : string
-
Last valid view parameter value
Return values
void —setLimit()
Change the value of the limit
public
setLimit(int $l) : void
Parameters
- $l : int
-
New limit value.
Return values
void —setOptions()
Set the search options object.
public
setOptions(Options $options) : void
Parameters
- $options : Options
-
Options to use
Return values
void —setOverrideQuery()
Set the override query
public
setOverrideQuery(string $q) : void
Parameters
- $q : string
-
Override query
Return values
void —setPage()
Change the page
public
setPage(int $p) : void
Parameters
- $p : int
-
New page value.
Return values
void —setQuery()
Set search query object.
public
setQuery(AbstractQuery $query) : void
Parameters
- $query : AbstractQuery
-
Query
Return values
void —setQueryAdapter()
Set query adapter
public
setQueryAdapter(QueryAdapterInterface $queryAdapter) : void
Parameters
- $queryAdapter : QueryAdapterInterface
-
Query adapter
Return values
void —setQueryIDs()
Override the normal search behavior with an explicit array of IDs that must be retrieved.
public
setQueryIDs(array<string|int, mixed> $ids) : void
Parameters
- $ids : array<string|int, mixed>
-
Record IDs to load
Tags
Return values
void —setSort()
Set the sorting value (note: sort will be set to default if an illegal or empty value is passed in).
public
setSort(string $sort[, bool $force = false ]) : void
Parameters
- $sort : string
-
New sort value (null for default)
- $force : bool = false
-
Set sort value without validating it?
Return values
void —setView()
Set the value for which search view we use
public
setView(string $v) : void
Parameters
- $v : string
-
New view setting
Return values
void —supportsFacetFiltering()
Check whether a specific facet supports filtering
public
supportsFacetFiltering(string $facet) : bool
Parameters
- $facet : string
-
The facet to check
Return values
bool —translate()
Translate a string (or string-castable object)
public
translate(string|object|array<string|int, mixed> $target[, array<string|int, mixed> $tokens = [] ][, string $default = null ]) : string
Parameters
- $target : string|object|array<string|int, mixed>
-
String to translate or an array of text domain and string to translate
- $tokens : array<string|int, mixed> = []
-
Tokens to inject into the translated string
- $default : string = null
-
Default value to use if no translation is found (null for no default).
Return values
string —translateFacetValue()
Translate a facet value.
public
translateFacetValue(string $field, string|TranslatableString $text) : string
Parameters
- $field : string
-
Field name
- $text : string|TranslatableString
-
Field value (processed by getFacetValueRawDisplayText)
Return values
string —buildDateRangeFilter()
Support method for initDateFilters() -- build a filter query based on a range of 4-digit years.
protected
buildDateRangeFilter(string $field, string $from, string $to) : string
Parameters
- $field : string
-
field to use for filtering.
- $from : string
-
year for start of range.
- $to : string
-
year for end of range.
Return values
string —filter query.
buildFullDateRangeFilter()
Support method for initFullDateFilters() -- build a filter query based on a range of dates.
protected
buildFullDateRangeFilter(string $field, string $from, string $to) : string
Parameters
- $field : string
-
field to use for filtering.
- $from : string
-
year for start of range.
- $to : string
-
year for end of range.
Return values
string —filter query.
buildGenericRangeFilter()
Support method for initGenericRangeFilters() -- build a filter query based on a range of values.
protected
buildGenericRangeFilter(string $field, string $from, string $to[, bool $cs = true ]) : string
Parameters
- $field : string
-
field to use for filtering.
- $from : string
-
start of range.
- $to : string
-
end of range.
- $cs : bool = true
-
Should ranges be case-sensitive?
Return values
string —filter query.
buildNumericRangeFilter()
Support method for initNumericRangeFilters() -- build a filter query based on a range of numbers.
protected
buildNumericRangeFilter(string $field, string $from, string $to) : string
Parameters
- $field : string
-
field to use for filtering.
- $from : string
-
number for start of range.
- $to : string
-
number for end of range.
Return values
string —filter query.
formatDateForFullDateRange()
Support method for initFullDateFilters() -- normalize a date for use in a year/month/day date range.
protected
formatDateForFullDateRange(string|null $date[, bool $rangeEnd = false ]) : string
Parameters
- $date : string|null
-
Value to check for valid date.
- $rangeEnd : bool = false
-
Is this the end of a range?
Return values
string —Formatted date.
formatFilterArrayAsQueryParams()
Format a raw filter array as a query parameter array.
protected
formatFilterArrayAsQueryParams(array<string|int, mixed> $filterArray) : array<string|int, mixed>
Returns an array of strings that parseFilter can parse.
Parameters
- $filterArray : array<string|int, mixed>
-
Filter array
Return values
array<string|int, mixed> —formatFilterListEntry()
Format a single filter for use in getFilterList().
protected
formatFilterListEntry(string $field, string $value, string $operator, bool $translate) : array<string|int, mixed>
Parameters
- $field : string
-
Field name
- $value : string
-
Field value
- $operator : string
-
Operator (AND/OR/NOT)
- $translate : bool
-
Should we translate the label?
Return values
array<string|int, mixed> —formatValueForNumericRange()
Support method for initNumericRangeFilters() -- normalize a number for use in a numeric range.
protected
formatValueForNumericRange(string|null $num[, bool $rangeEnd = false ]) : string
Parameters
- $num : string|null
-
Value to format into a number.
- $rangeEnd : bool = false
-
Is this the end of a range?
Tags
Return values
string —Formatted number.
formatYearForDateRange()
Support method for initDateFilters() -- normalize a year for use in a year-based date range.
protected
formatYearForDateRange(string|null $year[, bool $rangeEnd = false ]) : string
Parameters
- $year : string|null
-
Value to check for valid year.
- $rangeEnd : bool = false
-
Is this the end of a range?
Tags
Return values
string —Formatted year.
getCheckboxFacetValues()
Get a formatted list of checkbox filter values ($field => array of values).
protected
getCheckboxFacetValues() : array<string|int, mixed>
Return values
array<string|int, mixed> —getRawCheckboxFacets()
Return checkbox facets without any processing
protected
getRawCheckboxFacets() : array<string|int, mixed>
Return values
array<string|int, mixed> —initAdvancedSearch()
Support method for initSearch() -- handle advanced settings. Advanced searches have numeric subscripts on the lookfor and type parameters -- this is how they are distinguished from basic searches.
protected
initAdvancedSearch(Parameters $request) : void
Parameters
- $request : Parameters
-
Parameter object representing user request.
Return values
void —initBasicSearch()
Support method for initSearch() -- handle basic settings.
protected
initBasicSearch(Parameters $request) : bool
Parameters
- $request : Parameters
-
Parameter object representing user request.
Return values
bool —True if search settings were found, false if not.
initCheckboxFacets()
Initialize checkbox facet settings for the specified configuration sections.
protected
initCheckboxFacets([string $facetList = 'CheckboxFacets' ][, string $cfgFile = null ]) : bool
Parameters
- $facetList : string = 'CheckboxFacets'
-
Config section containing fields to activate
- $cfgFile : string = null
-
Name of configuration to load (null to load default facets configuration).
Return values
bool —True if facets set, false if no settings found
initDateFilters()
Support method for initFilters() -- initialize year-based date filters.
protected
initDateFilters(Parameters $request) : void
Factored out as a separate method so that it can be more easily overridden by child classes.
Parameters
- $request : Parameters
-
Parameter object representing user request.
Return values
void —initFacetList()
Initialize facet settings for the specified configuration sections.
protected
initFacetList(string $facetList, string $facetSettings[, string $cfgFile = null ]) : bool
Parameters
- $facetList : string
-
Config section containing fields to activate
- $facetSettings : string
-
Config section containing related settings
- $cfgFile : string = null
-
Name of configuration to load (null to load default facets configuration).
Return values
bool —True if facets set, false if no settings found
initFilters()
Add filters to the object based on values found in the request object.
protected
initFilters(Parameters $request) : void
Parameters
- $request : Parameters
-
Parameter object representing user request.
Return values
void —initFullDateFilters()
Support method for initFilters() -- initialize year/month/day-based date filters. Factored out as a separate method so that it can be more easily overridden by child classes.
protected
initFullDateFilters(Parameters $request) : void
Parameters
- $request : Parameters
-
Parameter object representing user request.
Return values
void —initGenericRangeFilters()
Support method for initFilters() -- initialize range filters. Factored out as a separate method so that it can be more easily overridden by child classes.
protected
initGenericRangeFilters(Parameters $request[, string $requestParam = 'genericrange' ][, callable $valueFilter = null ][, callable $filterGenerator = null ]) : void
Parameters
- $request : Parameters
-
Parameter object representing user request.
- $requestParam : string = 'genericrange'
-
Name of parameter containing names of range filter fields.
- $valueFilter : callable = null
-
Optional callback to process values in the range.
- $filterGenerator : callable = null
-
Optional callback to create a filter query from the range values.
Return values
void —initHiddenFilters()
Add hidden filters to the object based on values found in the request object.
protected
initHiddenFilters(Parameters $request) : void
Parameters
- $request : Parameters
-
Parameter object representing user request.
Return values
void —initLimit()
Pull the page size parameter or set to default
protected
initLimit(Parameters $request) : void
Parameters
- $request : Parameters
-
Parameter object representing user request.
Return values
void —initNumericRangeFilters()
Support method for initFilters() -- initialize numeric range filters. Factored out as a separate method so that it can be more easily overridden by child classes.
protected
initNumericRangeFilters(Parameters $request) : void
Parameters
- $request : Parameters
-
Parameter object representing user request.
Return values
void —initPage()
Pull the page parameter
protected
initPage(Parameters $request) : void
Parameters
- $request : Parameters
-
Parameter object representing user request.
Return values
void —initRangeFilters()
Initialize all range filters.
protected
initRangeFilters(Parameters $request) : void
Parameters
- $request : Parameters
-
Parameter object representing user request.
Return values
void —initSearch()
Initialize the object's search settings from a request object.
protected
initSearch(Parameters $request) : void
Parameters
- $request : Parameters
-
Parameter object representing user request.
Return values
void —initShards()
Pull shard parameters from the request or set defaults
protected
initShards(Parameters $request) : void
Parameters
- $request : Parameters
-
Parameter object representing user request.
Return values
void —initSort()
Get the value for which type of sorting to use
protected
initSort(Parameters $request) : void
Parameters
- $request : Parameters
-
Parameter object representing user request.
Return values
void —initView()
Get the value for which results view to use
protected
initView(Parameters $request) : void
Parameters
- $request : Parameters
-
Parameter object representing user request.
Return values
void —parseOperatorAndFieldName()
Parse the operator and field name from a prefixed field string.
protected
parseOperatorAndFieldName(string $field) : array<string|int, mixed>
Parameters
- $field : string
-
Prefixed string
Return values
array<string|int, mixed> —(0 = operator, 1 = field name)