API Reference / API Parameters / filterPromotes
Type: boolean
Engine default: false
Parameter syntax
'filterPromotes' => true|false

Can be used in these methods:

About this parameter

Whether promoted results must match the current search filters.

Usage notes

  • When true, promoted results must match the current filters, excluding geographic filters.
  • When false, promoted results appear regardless of filters.

In the Algolia dashboard, when you choose the Pin an item consequence, filterPromotes appears as the checkbox: Pinned items must match active filters to be displayed. For examples of how to use filterPromotes in the Visual and Manual Editor, see Promote results with rules.

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?