There are two different possibilities to provide query suggestions:

  • suggest relevant search terms
  • provide matching products while typing

ContentOnTarget supports both methods. A possible realization and layout for this feature might look as following:


The suggestions can be retrieved by using the suggest API. It is available at


Possible parameters:

qStringxthe query term for which a suggestion is wanted
termsBoolean-specifies whether term suggestions should be provided, default=true
documentsBoolean-specifies whether documents (ShopOnnTarget: products) suggestions should be provided, default=true

JSON array of fiels that should be retrieved.

The requested fields have to match the CoreSchema specification. If no field is requested, following fields are provided by default:

  • uri
  • score
groupString-Provides a grouped suggestion result. The group parameter has to specify a field name which is single-valued and has group support enabled.


The response provides terms and product suggestions. The provided frequency is currently always -1.

   "terms":    [
         "suggestion": "suggestion 1",
         "frequency": "-1"
         "suggestion": "suggestion 2",
         "frequency": "-1"
   "documents":    [
         "productNumber": "productID_1925",
         "title": "product 1"
         "productNumber": "productID_1983",
         "title": "product 2"

PHP API Client

The PHP API client provides full support for the search suggestions. You can use it either in an autosuggest context or in any other scenario that seems to be useful.

$config = com\repalogic\ContentOnTarget\Client\Configuration::getConfig("", "userName", "userApiHash", "coreName", "coreApiHash");
$suggestApi = com\repalogic\ContentOnTarget\Client\SuggestApi($config);
//get term suggestions for 'sear'
$suggestResults = $suggestApi->suggest("sear",true,false);
//get product suggestions for 'sear'
$suggestResults = $suggestApi->suggest("sear",false,true);
//get term and product suggestions for 'sear' at once
$suggestResults = $suggestApi->suggest("sear",true,true);