metzelder
metzelder

Reputation: 734

Google Search Appliance query request returns 502

In my Java project, i am using the GSA Java API as an helper querying and getting results of a search. According to the API documentation, i believe i have done everything correct by the book. To test my first search operation, i have construct following URL

URL: http://myHOST:myPORT/search?access=p&output=xml&client=&lr=tr&num=100&site=myXMLCollection

and post it to the API hoping i was getting the results. But HTTP 502 error shows up.

java.io.IOException: Server returned HTTP response code: 502 for URL: http://myHOST:myPORT/search?access=p&output=xml&client=&lr=tr&num=100&site=myXMLCollection
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1626)
    at java.net.URL.openStream(URL.java:1037)
    at net.sf.gsaapi.GSAClient.search(Unknown Source)
    at net.sf.gsaapi.GSAClient.getGSAResponse(Unknown Source)
    at net.sf.gsaapi.GSAClient.getGSAResponse(Unknown Source)

Am i missing something among the sent parameters?

Upvotes: 0

Views: 234

Answers (1)

Mohan kumar
Mohan kumar

Reputation: 458

I could see couple of fields missing in your query. Add the below parameters.

  1. Query parameter i.e q=your term. If you are using java api, then set the query term using setQueryTerm(term) method.
  2. Add the client, i.e Frontend. You can set using setFrontend(frontend) method in the Java API.
  3. I persume your lr value is incorrect. It should be lr=lang_tr,if language is Turkish.

Regards, Mohan

Upvotes: 1

Related Questions