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

Use the Google Mini for a website that requires logging out of the Google Mini in JSON / JSONP format for login requests. The Google Mini publishes an XML feed that could potentially be used by the average process to convert to JSON / JSONP.

Can the Google Search Appliance / Mini be displayed in JSON / JSONP using a plug-in, XSLT template modification, or other unknown method?

Solutions found

  • It seems that digging through code.google.com shows that GSA / Mini does not have a JSON / JSONP output method without using XSLT to create a feed. It's about creating this XSLT for conversion.
  • Another option is to create the server side of the script using available technology (PHP?) To extract XML from GSA / Mini and convert the feed to JSONP upon request from Front-end (AJAX). The disadvantage is the increase in overhead for this call.

Update 10/8/2010

A Google Mini interface has been created that generates a JSONP response.

+4
source share
2 answers

I had the same issue as JSON and JSONP. The solution worked in general in all other browsers, but IE. I could not change the mime type to anything other than text / html, as it was global in GSA. Created XSLT to solve this problem for browsers such as IE that will not allow content to be returned due to a security feature (IE - SEC7112)

https://github.com/kjonnala/gsa_template

Hope this helps.

+8
source

I am working on approach number 2 above. We have version 6.4 of the device, and it provides JSON for a suggestion (possibly new from Riley's question). For instance:

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

What I came across is that cross-domain restrictions prevented the use of the JSON service of the device on non-standard forms of website searches, including subdomains of our common high-level domain.

I am testing a simple Java servlet that now invokes a call. It accepts incoming requests, receives a response from the device, displays it in JSONP, and sends it back to the calling page.

There are a few links I found related to proxying the hint 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 are related to JSONP with jQuery:

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

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

JSON for JSONP in the servlet is fast and probably messy in the approach I take :)

This is not yet in production, so I can’t talk about what we will find in terms of productivity and other problems. I like that the service is provided from a secondary server, and not directly from the device (taking into account throttling of incoming requests, if necessary, etc.), If the performance can keep up.

October 1, 2010 Update

Sorry - my message above only refers to the service offered, and not to general search results. You can still take the XML response, process it and wrap it in JSON / JSONP, but it will take longer than I suspect. I used JSONP in the context of suggesting search queries with jQuery autocomplete, so it is important to have a quick response (by type).

+2
source

Source: https://habr.com/ru/post/1310435/


All Articles