You are here

function facetapi_facet_load in Facet API 7.2

Same name and namespace in other branches
  1. 6.3 facetapi.module \facetapi_facet_load()
  2. 6 facetapi.module \facetapi_facet_load()
  3. 7 facetapi.module \facetapi_facet_load()

Returns a facet definition.

Parameters

$facet_name: The machine readable name of the facet.

$searcher: The machine readable name of the searcher.

Return value

An array containing the facet definition, FALSE if the facet is invalid.

  • name: Machine readable name of the facet.
  • label: Human readable name of the facet displayed in settings forms.
  • description: Description of the facet displayed in settings forms.
  • field: The field name used by the backend to store and retrieve data from the search index it is associated with.
  • field alias: The query string variable inside of the filter key used to pass the filter information through the query string.
  • field api name: The machine readable name of the Field API field data the facet is associated with, FALSE if it is not associated with a field.
  • field api bundles: An array of entity names that this field contains bundle information for.
  • query types: The query type plugins that that this facet supports. For example, numeric fields support "term" and "range_filter" queries.
  • alter callbacks: Callbacks that alter the initialized render array returned by the query type plugin. Defaults to an empty array.
  • dependency plugins: An array of dependency plugin IDs that are supported by this facet.
  • default widget: The widget plugin ID used if no plugin has been selected or the one selected is not valid.
  • allowed operators: An array keyed by operator constant to boolean values specifying whether the operator is supported.
  • facet missing allowed: Whether or not missing facets are allowed.
  • facet mincount allowed: Whether or not the facet supports the "minimum facet count" setting.
  • weight: The weight of the facet
  • map callback: The callback used to map the raw values returned by the index to something human readable.
  • map options: An array of options passed to the map callback.
  • hierarchy callback: A callback that maps the parent / child relationships of the facet data, defaults to FALSE meaning the list is flat.
  • values callback: In instances where facet data is not returned by the backend, provide a list of values that can be used.
  • min callback: For facets containing ranges, a callback returning the minimum value in the index.
  • max callback: For facets containing ranges, a callback returning the maximum value in the index.
  • default sorts: An array of available sorts. Each item is an array containing two values, the first being the item being filtered on, the second being the SORT_* constant.
10 calls to facetapi_facet_load()
CurrentSearchGroup::execute in contrib/current_search/plugins/current_search/item_group.inc
Implements CurrentSearchItem::execute().
FacetapiApiFunctions::testHierarchicalRequirements in tests/facetapi.test
Tests the requirements system for hierarchies.
FacetapiApiFunctions::testUrlProcessorDataProcessing in tests/facetapi.test
Test active item processing via the url processor plugin.
FacetapiTestCase::facetapiLoadObjects in tests/facetapi.test
Returns adapter, realm, and facet objects and base admin path.
facetapi_dependencies_load in ./facetapi.module
Loads the dependency plugins associated with the facet.

... See full list

File

./facetapi.module, line 474
An abstracted facet API that can be used by various search backends.

Code

function facetapi_facet_load($facet_name, $searcher) {
  $facet_info = facetapi_get_facet_info($searcher);
  return isset($facet_info[$facet_name]) ? $facet_info[$facet_name] : FALSE;
}