Skip to content

Simplified getFacet method return value.

Compare
Choose a tag to compare
@JoeZ99 JoeZ99 released this 16 Mar 15:31
· 87 commits to master since this release

WARNING: Breaking changes

The getFacet('price') has changed. Old functionality is available through getLegacyFacet('price').

New return values for getFacet() are:

Terms Facets

  array(
    'count' => 232,
    'terms' => array(
      array(
        'term' => 'France',
        'count' => 23,
        'selected' => false // if previously selected as a filter
      ),
      array(
        'term' => 'Spain',
        'count' => 2,
        'selected' => true
      ),
      ...
    )
  );

Range Facets

array(
  'count' => 232,
  'from' => 23.2,
  'to' => 443.1,
  'selected_from' => 44, // if se;ected as filter. false otherwise
  'selected_to' => 401   // if selected as filter
);