Skip to content

Advanced search using collections

This section is under development

Collections are used to make the search blocks work, this includes facets, simpleSearch, multiSearch, searchList, searchFilter, clear, results, filterResults, and collectionText blocks.

  1. inline - an array of objects with label and value in the list attribute.
  2. rdforms - reuse "choices" from RDForms template choice items as they already provide labels and values. Reuse by providing item id in the templatesource attribute.
  3. preload - preload collection from entrystore, this is done by providing the constraining attributes rdftype and an optional context.
  4. search - a solr search will be performed to yield a collection of the matching entries, typically by combining a given rdftype attribute with a generic search term, for instance from typeahead input field.
  5. facet - the latest solr search performed by the search block (with the facet flag) will yield a collection from the facets in the results. The property attribute is mandatory to indicate the facet and an nodetype must be specified to be literal if the facet values are not to be treated as URIs which is the default.
  6. range - the collection corresponding to values that can be searched for via range queries like properties with dates or integers.
  7. check - entries with given values for a given property will be included in or excluded from the search result. type, name, property, nodetype and values are mandatory. related: 'true' is optional. Also modifier (values not / and) is optional and will default to modifier: 'and'
  8. radio - a more complex filter where entries matching a selected option query will be included in the search result. type, name and options are mandatory where options is an array of option objects. each option needs a name, a query and a label. The query is written as an object and only supports using rdfType, and and or. e.g. query: { rdfType: ['dcat:Dataset'], and: { not: { 'tag.literal': 'camping' } } }. See documentation https://entrystore.org/js/stable/doc/module-store_SolrQuery.html for correct syntax and expected behaviour.

Parameters in a collection

Parameter Value Description
type string Must be one of the values, listed above
name string Mandatory unique name of collection, used from other blocks to reference it
label string A nice label to show as headings in facet and multiSearch block
facetMissingLabel string A nice label for the facet result returned when the global level facetMissing parameter is set to true global parameter facetMissing. Default label is None
multiSelect boolean Make multiple options selectable in the facet block. Only applicable to collections of type facet and takes effect when collection is used in a facet block
property RDF property The property to constrain in the query
nodetype string Must be either literal, uri, date or integer.
context string The contextid to restrict a query for values from, use when the type parameter is search
rdftype RDF class A URI corresponding to a RDF class from which values in this collection have to be instances of, use when the type parameter is search
limit number Restriction on how many values that will be shown in the facet or multiSearch blocks before there is a showmore button
showmore string Text to show on the show more button
showless string Text to show on the show less button
labelRegexp RegExp Regular expression that will extract parts of the labels via capturing groups
labelTemplate string template Expression with variables 1 and 2 inside corresponding to up to two capturing groups or the whole label if there are now labelRegExp, for example ${1} municipality
click url The url the user will go to if clicking on an individual value, the esb: prefix is allowed. See the documentation on the multiSearch block
namedclick string A named click, see documentation on the multiSearch block
linkparam string Must be used together with the click or namedclick parameters. If the value entry is given the selected entries entryid and contextid will be inserted via the esb_entry and esb_context parameters in the link. If the value is group the collection name is used as parameter name and the value is the selected value. In all other cases the value of the linkparam will be used as param. In all situations, the value is first shortened if possible.
templatesource string The id of an rdforms template from where values for the collection will be retrieved, this only works if the type is rdforms and the identified template corresponds to a choice item with static choices
sort boolean/'desc' If true values will be in alphabetical order if set to 'desc' the order is reversed
resets string The name of a collection to reset when this filter is activated