The facets variable describes the current search facets. It is available in the Search results designer, Result templates designer, and Custom (search) component.
facets contains the facets field for the response body to the Clustered search web service.