More Information About Sticky Facets - AFS

AFS Integration Guide

Reference Guide

Say you are using the facets in your quest for the ideal chocolate...

There are two facets in front of you:

  • Ingredients (multi-valued)
  • Shape (mono-valued)

You refine your search focusing only on "black chocolate" with "nuts", selecting these items in the ingredients facet.

The Shape facet now displays the following four available shapes for black chocolate with nuts:

  • round
  • square
  • diamond
  • hexagon

You then select the round shape.

The Shape facet being sticky, AFS reply contains the very same four values as before.

The Shape facet does not contain all its available values, but only those relevant in the current filtering context.

This gives you the ability to both see and choose instead another shape available for the currently selected ingredients. For instance, it is now possible to select the diamond shape.

Prior to the introduction of the sticky feature, this facet would have only displayed the currently selected value. In that case, selecting another would have involved the two following steps:

  • Un-select the currently selected shape in order to see the other shapes available.
  • Select the new shape.

  • Mono-valued facets and or-facets are implicitly sticky.

This cannot be changed in any way, even via its configuration (FacetDescriptors[n].sticky).

That is, each time AFS-Widget send a query involving this kind of facet, sticky=true is set in the request.

  • Multi-valued facets are not sticky by default ("sticky": false).

To make them sticky, set "sticky" to true in the FacetDescriptors section.


<div class="AFSWidget" title="Configuration">
<script type="application/json">
"afsPath": "/proxy-foo-dev",
"afsDefaults": {
"afs:service": 1,
"afs:status": "stable",
"afs:lang": "fr",
"afs:facetOrder" : "brand,shape,ingredients"
"facetDescriptors": [
{"id": "brand", "or": true},
{"id": "shape", "monoValued": true},
{"id": "ingredients", "sticky": true}
"logLevel": "DEBUG"

In the above example, three facets are sticky:

  • brand is (implicitly) sticky because it is an or facet,
  • shape is (implicitly) sticky because it is mono-valued,
  • ingredients is sticky because it is has been made so explicitly, using "sticky": true.

Other multi-valued facets if any are not sticky (default).