Google Programmable Search Engine

In a default installation, a site will be set up to use Google Programmable Search Engine (PSE, formerly Custom Search Engine). This relies on Google to do the heavy lifting of search indexing & relevance. You define what pages should be indexed and Google returns results for only those pages. Visitors will view the Google search results from within your site. Read an overview of how CSE works.

Google PSE is integrated into your site using the :ref:`Google PSE module <https://www.drupal.org/project/google_cse>`_. It leverages the Drupal interface for defining where the search box should show up and how that search box should look. Practically speaking, this means that switching a site to a different option should require minimal or no cosmetic changes.

Important

The following assumes you’ve visited Google’s Programmable Search Help pages and control panel and have done the following:

  • setup the domains or websites you’d like to use search for, or wish to exclude from Programmable Search from

  • obtained a Google Programmable Search ID

If you haven’t, be sure to read Google’s documentation.

Configure Google Programmable Search in a site

Add the ID to a site

Navigate to Configuration > Search (/admin/config/search/pages) and click the “Edit” button at the bottom of the page for the Google CSE search option. At the top of the configuration page, replace the default ID with the ID you got from Google. Complete the other configuration options as desired.

Sites usually will not need other Drupal core search pages enabled. For more detail, see https://www.drupal.org/docs/8/core/modules/search/overview

Remove search altogether

Some sites may not want or need site search. Removing it is a two-step process.

  1. Remove the “Search form” block from the “Header Tertiary” region on the site’s block configuration page by going to Structure > Block layout (admin/structure/block).

  2. Proceed to uninstall the Google CSE module and the core “Search” module at Extend > Uninstall (/admin/modules/uninstall).