开发者

Google custom site search via XML...how to get the "did you mean..." value?

I am developing a search solution for my photo community web application. I am making use of Google Site Search. There are various ways to make use of it, but because I want a seamless fit with custom search result rendering, I went for the XML option.

It works really simple. I have a custom-styled search box on the site which posts to my back-end, a CodeIgniter PHP controller. The controller then will do a GET to the Google Site Search XML service, which returns me the search results in XML.

It works brilliantly and gives me full control over output rendering. There is just one little thing missing. If I search for a misspelled word, let's say "crocodilw" (should be "crocodile") I would like to get the "did 开发者_如何转开发you mean "crocodile?" functionality that is so common in Google.

This feature does work when you use the front-end integration method of Google Site Search. I kind of expected the correct search suggestion to be part of the return XML as well, but I can't seem to find it.

Any clues on how/if this is possible using the XML method?


This will only work on the first page (start=0) of the results. On the second page, it's gone.

http://www.google.com/cse/docs/resultsxml.html#results_xml_tag_Spelling

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜