FacetHelper::buildFacets
This is super-slow. I'm assuming if you're using facets you probably also ought to be using Solr or something else. Or maybe you have unlimited time and can refactor this feature and submit a pull request...
TODO: If this is going to be used for categories we're going to have to really clean it up and speed it up. Suggestion: - option to turn off counts - switch order of nested array so we don't go through results unless needed - if not doing counts, min/max and link facets can be handled w/ queries - separate that bit out into a new function NOTE: This is partially done with the "faster_faceting" config option but more could be done, particularly by covering link facets as well. Output - list of ArrayData in the format: Label - name of the facet Source - field name of the facet Type - one of the ShopSearch::FACET_TYPE_XXXX constants Values - SS_List of possible values for this facet
Signature
public function buildFacets(SS_List
$matches,
array
$facetSpec,
[boolean
$autoFacetAttributes = false] )
Parameters
$matches
— SS_List
$facetSpec
— array$autoFacetAttributes
— boolean- [optional]
Returns
- ArrayList