Restrict Fields in Response

When configuring a Search Query Template, you can easily decide which search query properties should be included in the results visible on the storefront.

Context

For the purpose of this use case, let's assume that you have created a search query template with the following query properties: name, priceValue, code and img-515Wx515H to make sure the images are rendered. The results you get when writing camera in the search field should look similar to what you can see in the following figure:

Procedure

  1. Navigate to your SUGGESTIONS template. If you need help, see Access Search Query Templates
  2. In the Query Template tab of the editor set Restrict fields in response to true. With this setting, only the properties with Include in response checked will be included in the response.

    Remember to click Save, otherwise you changes will be lost.

  3. Go to the Query Properties tab and double-click the img-515Wx515H property.
  4. Set Include in response to false. Remember to save your changes after editing.
  5. Close the query properties window to return to the main window. Save your changes.
  6. Go to the storefront and start writing camera in the search field.

    The images are not included in the results.

Results

You can easily narrow down the number of fields displayed in the response.