Problem while fetching xml

14 views
Skip to first unread message

Filippo Macchi

unread,
May 5, 2011, 5:34:31 AM5/5/11
to Google Search Appliance/Google Mini - Google Search Appliance/Google Mini
Hi, I'm new on GSA and I'm developing custom front end to show data
result and I have a big problem using synonyms, infact GSA doesn't
recognize the language in http headers despite I'm using
"wr.Headers.Add("Accept-Language: it-IT");"

It works instead with spelling function.

Very strange.

What can I do so solve this issue?

Actually I'm using this method to retrive xml from GSA:

private XmlReader GetXmlContent(string contentUrl)
{
try
{
var wr =
(HttpWebRequest)WebRequest.Create(contentUrl);
wr.Headers.Add("Accept-Language: it-IT");
var resp = wr.GetResponse();
var stream = resp.GetResponseStream();
var reader = new XmlTextReader(stream) {XmlResolver =
null};

return reader;
}
catch
{
return null;
}
}

Richard Haine

unread,
May 5, 2011, 10:09:07 AM5/5/11
to google-search-...@googlegroups.com
Hi,

I'm not too familiar with the language settigs with teh GSA but have found something in teh docs that may help. Try using "lang_it" in place of "it-IT".

The documentation can be found here:
http://code.google.com/apis/searchappliance/documentation/68/xml_reference.html#request_subcollections

If you are not using version 6.8 of the GSA, replace /68/ with the version you have.


Hope this helps.

Richard


--
You received this message because you are subscribed to the Google Groups "Google Search Appliance/Google Mini" group.
To post to this group, send email to Google-Search-...@googlegroups.com.
To unsubscribe from this group, send email to Google-Search-Applia...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/Google-Search-Appliance-Help?hl=en.




--
Thanks,
Richard Haine
richar...@gmail.com

Dave Watts

unread,
May 5, 2011, 10:25:47 AM5/5/11
to google-search-...@googlegroups.com
> I'm not too familiar with the language settigs with teh GSA but have found
> something in teh docs that may help. Try using "lang_it" in place of
> "it-IT".

That's used for the lr query parameter, but is not a valid value for
an Accept-Language HTTP request header.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

Dave Watts

unread,
May 5, 2011, 10:26:53 AM5/5/11
to google-search-...@googlegroups.com
> Hi, I'm new on GSA and I'm developing custom front end to show data
> result and I have a big problem using synonyms, infact GSA doesn't
> recognize the language in http headers despite I'm using
> "wr.Headers.Add("Accept-Language: it-IT");"

Are you able to get the correct data directly from the browser, with
the browser set to accept Italian?

Filippo Macchi

unread,
May 5, 2011, 10:36:16 AM5/5/11
to Google-Search-...@googlegroups.com, google-search-...@googlegroups.com
Yes, if I use the same querystring in browser I'll get the correct result set.

Well an interesting thing is that, before I use the code

wr.Headers.Add("Accept-Language: it-IT"); 

I don't get the spelling tag in xml only after added it. So I suppose that code is correct because now I have the spelling/suggestion tags.


Dave Watts

unread,
May 5, 2011, 10:53:39 AM5/5/11
to google-search-...@googlegroups.com

In that case, I'd compare the HTTP request headers you're sending from
your app with those from your browser. Maybe there's something else
that's not being sent?

Reply all
Reply to author
Forward
0 new messages