Integrating Suggest via XML

This method works in the same way as the HTTP Interface (via Suggest.ff), except that the parameter format=xml must be supplied when calling the HTTP interface.

$stringEscapeUtils.escapeHtml($body)

The output is structured as follows:

<ff xsi:noNamespaceSchemaLocation="schema/7.2/ffsuggest.xsd">
  <suggest nr="0" query="Helm für Kinder" hitcount="206" type="category" imageUrl="helm_kids_medium.jpg">
    <attributes>
      <attribute name="sourceField">category3</attribute>
    </attributes>
    <searchParams>...searchParams url...</searchParams>
  </suggest>
  <suggest nr="1" query="helm" hitcount="1281" type="searchTerm">
    <searchParams>...searchParams url...</searchParams>
  </suggest>
...
</ff>

Each suggest tag in the output represents a search suggestion. The attribute nr is an index, query contains the search suggestion text, hitcount describes the number of expected hits, and type contains the type of suggestion. The attribute imageUrl is optional and is only available if a preview image exists for the suggestion, in which case it contains the link to the image. The value of hitcount may be 0 if no hit count was calculated or derived from the log files. The searchParams tag contains the link target URL for the selection of the suggestion.

Search suggestions can contain additional information, some of which is supplied by default and some of which is inserted on demand. Each additional attribute is returned in the form of an attribute tag within the attributes collection. If no attributes are returned, these tags are not included. An attribute consists of an attribute name (the name attribute of the tag) and the attribute value, which is provided in the form of the tag value.