Google Custom Search API Autocomplete?

前端 未结 2 1110
陌清茗
陌清茗 2021-02-08 18:05

We\'re using the google custom search API (paid-for server-side API) to power our search results.

I\'d like to add an autocomplete feature to the search - however, does

2条回答
  •  春和景丽
    2021-02-08 18:15

    At the time of writing (June 2013), there is a somewhat easier way of getting autocompletion while still getting the results as XML:

    • Use the Google Custom Search Element Control (https://developers.google.com/custom-search/docs/element).
    • Just use the Search bar control, which you can style as you like.

    • The "trick" is that you can specify "resultsUrl" which means you can direct the actual search results to a page you generate via the XML API, without having to implement the search box UX yourself.

提交回复
热议问题