SearchMetaDataInterface
interface SearchMetaDataInterface
Interface SearchMetaDataInterface
This hook allows adding additional faceted filters to the search results page. To enable those filters, meta data has to be added to the search documents with \XELOS\Modules\Search\SearchIndexRecord::addMetaData().
Meta data can either be added by the module when SearchableDocumentModelInterface::onSearchIndexUpdate() is called or by using the SearchPreprocessor hook.
Methods
Define a custom aggregation for the meta_data. This aggregation can be used for counts of the custom values.
Returns an array of Fields which define which fields are available for filtering and which for sorting.
Returns the keys used in the index which should be displayed as faceted filters.
Returns the label for the given meta data key.
Returns the label for the given meta data value. Return the value if it is unchanged.
Returns the search query for the given key and value.
Enables custom values with their own counts instead of the values defined when writing to the search index.
Details
at line 76
array|null
getAggregation()
Define a custom aggregation for the meta_data. This aggregation can be used for counts of the custom values.
This aggregation will be passed to getValuesForKey.
at line 29
array
getFields()
Returns an array of Fields which define which fields are available for filtering and which for sorting.
at line 36
array
getKeys()
Returns the keys used in the index which should be displayed as faceted filters.
at line 45
string
getLabelForKey(string $key)
Returns the label for the given meta data key.
at line 55
string
getLabelForValue(string $key, string $value)
Returns the label for the given meta data value. Return the value if it is unchanged.
at line 66
array
getSearchQuery(string $instanceId, string $key, string $value)
Returns the search query for the given key and value.
at line 89
array
getValuesForKey(string $key, array $values, array $aggregation)
Enables custom values with their own counts instead of the values defined when writing to the search index.