API Reference / API Parameters / filterPromotes

filterPromotes

Type: boolean
Engine default: false
Parameter syntax
'filterPromotes' => true|false

Can be used in these methods:

About this parameter

Whether promoted results should match the filters of the current search, except for geographic filters.

Usage notes:

  • When true, promoted results will be restricted to match the filters of the current search, except for geographic filters.
  • When false, the promoted results will show up regardless of the filters.
  • This parameter only applies to non-geographic filters; ie. geographic filters are ignored and promoted hits may not match them.

Examples

Enable filtering of promoted results

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$rule = array(
  'objectID' => 'rule_with_filterPromotes',
  'conditions' => array(array(
    'pattern' => '{facet:brand}',
    'anchoring' => 'is'
  )),
  'consequence' => array(
    'filterPromotes' => true,
    'promote' => array(
      'objectID' => 'promoted_items',
      'position' => 0
    )
  )
);

Did you find this page helpful?