Can a Google Search Appliance / Mini output JSON/JSONP? Can a Google Search Appliance / Mini output JSON/JSONP? json json

Can a Google Search Appliance / Mini output JSON/JSONP?


I had the same problem trying to get JSON and JSONP. The solution worked in general on all other browsers, but IE. I could not change the mime-type to something other than text/html since that was global in GSA. Created an XSLT to solve that problem for browsers like IE which will not allow content to be returned due to a security feature ( IE – SEC7112 )

https://github.com/kjonnala/gsa_template

Hope that helps.


I'm working on approach #2 above. We have version 6.4 of the appliance and it provides JSON for the suggestion service (probably new since Riley's question). For example:

http://code.google.com/apis/searchappliance/documentation/64/xml_reference.html#RichOutputFormat

What I ran into was that cross-domain limitations prevented using the appliance JSON service on non-appliance website search forms, including those in subdomains of our shared high level domain.

I'm testing a simple Java servlet now that makes the suggest call. It takes incoming requests, gets the response from the appliance, outputs in JSONP and sends back to the calling page.

There are a couple references I've found related to proxying the suggest service:

http://groups.google.com/group/Google-Search-Appliance-Help/browse_thread/thread/72406a271a6d9917/

http://www.mcplusa.com/blog/2009/07/adding-google-search-appliance-suggest-search-to-your-existing-page/

http://sites.google.com/site/lightbends/gsa_qs_6_2

and some related to JSONP with jQuery:

http://devlog.info/2010/03/10/cross-domain-ajax/

http://www.ibm.com/developerworks/library/wa-aj-jsonp1/

JSON to JSONP in the servlet is quick and probably dirty in the approach I'm taking :)

It's not in production yet, so I can't speak to what we'll find in terms of performance and other challenges. I like that the service is exposed from a secondary server rather than directly from the appliance (allowing for throttling of incoming requests if needed, etc.) if the performance can keep up.

October 1, 2010 Update

Sorry - my post above applies only to the suggest service and not to the general search results. You could still take the XML response, process and wrap that in JSON/JSONP, but that would take longer I suspect. I was using the JSONP in the context of suggesting search queries with jQuery autocomplete, so having the quick response (as they type) is important.