QueryComponentFacetTrait
Trait QueryComponentFacetTrait deals with the facets.
Faceting for any given query or index.
Table of Contents
Properties
- $clientQuery : Query
- $index : BaseIndex
- $query : BaseQuery
Methods
- buildAndFacetFilterQuery() : mixed
- Add AND facet filters based on the current request
- buildOrFacetFilterQuery() : mixed
- Add OR facet filters based on the current request
- buildQueryFacets() : void
- Add facets from the index, to make sure Solr returns the expected facets and their respective count on the correct fields
- createFacetCriteria() : mixed
- Combine all facets as AND facet filters for the results
- getFieldFacets() : array<string|int, mixed>
- Get the field and it's respected values to filter on to generate Criteria from
Properties
$clientQuery
protected
Query
$clientQuery
Solarium query
$index
protected
BaseIndex
$index
Index to query
$query
protected
BaseQuery
$query
Query to use
Methods
buildAndFacetFilterQuery()
Add AND facet filters based on the current request
protected
buildAndFacetFilterQuery() : mixed
buildOrFacetFilterQuery()
Add OR facet filters based on the current request
protected
buildOrFacetFilterQuery() : mixed
buildQueryFacets()
Add facets from the index, to make sure Solr returns the expected facets and their respective count on the correct fields
protected
buildQueryFacets() : void
createFacetCriteria()
Combine all facets as AND facet filters for the results
protected
createFacetCriteria(null|Criteria &$criteria, string $field, array<string|int, mixed> $filter) : mixed
Parameters
- $criteria : null|Criteria
- $field : string
- $filter : array<string|int, mixed>
getFieldFacets()
Get the field and it's respected values to filter on to generate Criteria from
protected
getFieldFacets(array<string|int, mixed> $filterFacets, array<string|int, mixed> $config) : array<string|int, mixed>
Parameters
- $filterFacets : array<string|int, mixed>
- $config : array<string|int, mixed>