Restrict Fields in Response

When configuring Search Query Templates, you can decide which properties to include in the storefront search results.

Context

Let's assume that you have created a search query template with the following query properties: name, priceValue, code, and img-515Wx515H. You can choose to either show or hide the object images from the search results. In this use case, we will restrict the img-515Wx515H property in the Query Template.

Procedure

  1. Navigate to your SUGGESTIONS template. See, Access Search Query Templates
  2. In the Query Template tab, set Restrict fields in response to true.

    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. Doing so will ensure that the selected property (image in this case) is not included in the search result.
  5. Close the query properties window to return to the main window. Save your changes.
  6. Go to the storefront and type camera in the search field.

    The images are not included in the results.

Results

With this configuration, you can easily narrow down the number of fields displayed in the response.