There are two different possibilities to provide query suggestions:
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
|q||String||x||the query term for which a suggestion is wanted|
|terms||Boolean||-||specifies whether term suggestions should be provided, default=true|
|documents||Boolean||-||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:
|group||String||-||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.
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.