How to serve JSON on the GSA on 7.6
For maximum flexibility, Google Search Appliance provides search results in XML format. Using the Google XML results, you can use your own XML parser to customize the display for your search users.
Additionally, GSA has a built-in XSLT (eXtensible Stylesheet Language Transformation) server, and can generate custom HTML using your XSL stylesheet.
Starting from version 7.6, GSA can serve results in JSON format. You can use the following steps in order to get results in JSON:
- Navigate to "Search > Search Features > Front Ends" and create a new frontend "json" (enter "json" into "Front End Name" textbox and click "Create").
- On the "Search > Search Features > Front Ends" page click Edit near "json" frontend
- Click "Edit underlying XSLT code"
- Click "Choose File", select "json_stylesheet.en.xslt" and click "Import". After that click Save.
- Change "HTTP Response Content-Type Header" from "text/html" to "json/application" and click Save.
- Change "HTTP Response Access-Control-Allow-Origin Header" to your content server hostname/ip (or enter "*" symbol to allow all the hosts) and click Save.
- Perform a search query with "proxystylesheet=json" option and see expected results in json format in the downloaded file.