SilverStripe solr Search

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

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>
Return values
array<string|int, mixed>

        
On this page

Search results