Search API Endpoint
After you have added search server, index, facets (optional) and autocomplete settings (optional), now it is time to create your first search endpoint.
Search endpoint is a config entity that stores information on how the search could be performed on the given index, with given facets and autocomplete settings (in case the modules are installed).
Search endpoint overview page is located here /admin/config/search/search-api/endpoints ("Configuration -> "Search and metadata" -> "Search API" -> "Endpoints"). There it is possible to manage (add/edit/delete) endpoints.

Config properties
The main setting for the endpoint is of course "Search Index". In the list you will find all the indexes, that were created with help of Search API module. Among other important settings is the "Parse mode". Search API provides the plugins for parsing the search keywords. This list can be extended with contrib and custom plugins.
There are also settings for number of items served per page and default sorting or results. Moreover, it is possible to allow users to change number of items per page, but also control what options they have.

UI Elements
If search_api_decoupled_ui submodule is enabled, there is "UI elements" tab, that has settings for the search block display. It is possible to select search display layout and also place search UI elements to any region of the layout:

Layouts
Layouts are provided by Drupal core module "Layout Discovery". This module also ships 3 basic layouts: "One column", "Two columns" and "Three columns". Layouts are defined in module's .layouts.yml file. It is possible to create your own layouts in custom module or theme. This modules filters layouts by category "Search". This way to have your own layout available you need to add category: 'Search' in layout definition.
Standard Layouts Description
- One column layout has only one region "Content". All UI elements will be added to it.
- Two columns layout consists of 4 regions: "Top", "First" (middle left), "Second" (middle right) and "Bottom".
- Three columns layout consists of 5 regions: "Top", "First" (middle left), "Second" (middle center), "Third" (middle right) and "Bottom".
Using Endpoint
Each search endpoint has its own access control with permission. This way some of them can be available only for certain user roles.
The endpoint route is: GET /api/search/{search_api_endpoint}, where {search_api_endpoint} is the machine name of Search API Endpoint.
Filters
- Main filter is full text search filter. To search for words query parameter
qshould be used. - It is possible to filter by any non full text fields of the index by just passing field name to query parameters, e.g.
nid=10. It is also possible to have array values likenid[]=10&nid[]=11. - Faceted search uses query parameter
for any other that is set in the facet source configuration. To search by facet one needs to use following query parametersf[0]=facet_name:filter_value&f[1]=another_facet_name:another_facet_value - It is also possible to sort by any index field in both
ascanddescorder. For sortingsortquery parameter is used, for order of sorting -order. - Pagination starts with page 0 and can be controlled with
pagequery parameter. It is also possible to passlimitparameter to control number of items per page. For this configuration of endpoint should allow it and provide the options to select from (free choice is not allowed).
Example:
Request GET /api/search/default?q=drupal&sort=nid&f[0]=date:2021-12
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion
Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.