Sites Search API¶
Sites Search API lets one Search API index serve every site. Its Sites processor stores the sites each item belongs to in the Sites field and narrows every search by it:
- On a site, a search finds the items of that site: on Torqline, About Torqline, the T200 page and the press release Torqline shares. An item on no site is found on the sites that take no content of its type, where its page answers as well, and on none that does.
- On the hub, a search finds the items that belong to any site, and the items on no site whose type no site takes.
- With Sites language, a search on a site finds only items in the site's languages, and language-neutral ones.
The index holds one document per item, built from the original: what a site changes in an override, like Hydrion's title of the press release, is not searchable.
Install¶
A project of its own, drupal.org/project/sites_search_api:
composer require drupal/sites_search_api
drush en sites_search_api
Requires search_api (search_api), Sites.
Configure¶
Set it up per index:
- Edit the index at
/admin/config/search/search-api. The processor is offered for indexes with an entity datasource. - On the Processors tab, enable Sites and save. The index gets the Sites field, which stays on it while the processor is enabled.
- On the index's View tab, click Queue all items for reindexing, then Index now.
Nothing is set per site or per site type. When an item's sites change without a save of the item, like in a bulk assignment, the item is queued for reindexing.
A search view with Bypass access checks in its query settings is narrowed neither by site nor by language.
To search all sites at once, search on the hub. An index without the Sites processor is not narrowed at all; a site's search with it would list items whose pages do not answer on that site.
Last updated 2026-11-04