Integrating the Tag Cloud via JSON

Tag Cloud can also be queried through a JSON interface. As with the search procedure, you simply add the parameter format=json to the URL to request the output be delivered in this format. An additional “wordCount” parameter allows you to limit the number of words that are returned.

Result structure

The JSON schema definition can be found under the following URL:

$stringEscapeUtils.escapeHtml($body)

The output consists of a list of multiple objects. Each member of the list represents an entry in the Tag Cloud. The search term is provided as the value of the query attribute, with the number of searches in searchCount and the calculated word weighting used to visualise the importance of the term in weight. The attribute params contains an URL with the search parameters for this term or – if the SEO Enhancer module is active – the corresponding SEO URL.

[
  {
    "params": "/AppName/Search.ff?query=buzz&channel=channelName",
    "query": "buzz",
    "searchCount": 18,
    "weight": 0.409583306449226
  },
  {
    "params": "/AppName/Search.ff?query=call+of+duty&channel=channelName",
    "query": "call of duty",
    "searchCount": 42,
    "weight": 1.0
  },
  ...
]