How to hide a field in a search interface?
When you generate an interface via console for a Site Search collection, we return title, description, URL, and image(optional) in the search results. In some instances, you might want to hide title, description, or URL.
Our default interface uses URL field for click-tracking, and it must be returned in response, otherwise, the click-tracking won’t function. Hence, if you try to remove URL field, it will return an error:
To hide ‘title’ or the ‘description’ field from the search interface:
- Generate an interface from the Integrate section in the console.
- After choosing the relevant options, and generating an interface, click on “View code“
- Add the “fields” parameter in the values object. See example below which will only return and render ‘title’ and ‘URL’:
Get started today.