Enable autocompletions in Google Custom Search

Note:
At IU, you can use Google Custom Search on your website free of charge as part of the Google at IU service.

Autocompletions, or search-as-you-type, is a feature found in Google Search and Google Custom Search (GCS). Autocompletions will display optional, suggested search queries as you type in the Google-supplied search box.

Autocompleted queries are generated, in part, on the pages indexed by your Custom Search Engine (CSE). This feature will not work for CSEs that search the entire web. To allow autocompletions to work, make sure Search only included sites is selected in the "Search Preferences" section of the Basic page in Google Custom Search Engine.

If you are making changes to an existing CSE that uses Custom Search Element Control API 1.0 code, you will need to update the CSE code on your website with the code provided on the "Get code" page of your CSE's control panel. If you are using the Custom Search Element Control API 2.0 code, you should not need to make any changes to the code on your website.

For reference:

  • The API 1.0 code includes:
      <div id="cse"></div>
    
  • The API 2.0 code is much cleaner and will include some code similar to:
      <gcse:search></gcse:search>
    

This is document bcwz in the Knowledge Base.
Last modified on 2022-09-30 16:32:05.