Data Object Structure - AFS

AFS Integration Guide

Product
AFS
AFS_Version
7.7
Category
Reference Guide

Find hereafter an example of the second parameter (presented in the JSON syntax).

{
   "facetTree":{ //Object representing the facet tree
      "afs:t":"FacetTree",
      "node":[ // List of facet values
         {
            "key":"Non", // Id of the value
            "labels":[
               { // Localized labels, here it is only in french
                  "lang":"FR",
                  "label":"Non"
               }
            ],
            "items":31199, // Number of documents related to this facet that match the current query
            "selected":false, // Tells whether the facet is currently selected or not
            "url":"#search;filter=commonsBolean%5C2%22Non%22;option=afs%3Asort%5C2afs%3Arelevance%2CDESC%26afs%3Areplies%5C220", // If facet values are links, it's the URL target that will select/unselect the facet
            "selectFacet": function() // A Javascript function to call to select the current facet value
         },
         { // Another facet value
            "key":"Oui",
            "labels":[
               {
                  "lang":"FR",
                  "label":"Oui"
               }
            ],
            "items":12521,
            "selected":true,
            "url":"#search;filter=option=afs%3Asort%5C2afs%3Arelevance%2CDESC%26afs%3Areplies%5C220",
            "unselectFacet": function() // Here, the value is selected, the function to call is unselectFacet
         }
      ],
      "layout":"TREE", // AFS Facet layout
      "type":"STRING", // Values type
      "id":"commonsBolean", // Id of the facet
      "labels":[
         { // Localized labels corresponding to the facet name
            "lang":"FR",
            "label":"Photos du monument ?"
         }
      ]
   },
   "selectedValues":[ // List of currently selected values
      "Oui"
   ],
"changeFacetValuesFunction": function() // Function that takes an array of the value ids to select (interacts with AFS Widgets)
}