The Search module provides a mirrored index of all CMS content that is optimized for search relevance, speed and accuracy. The Search module overrides the default search functionality to query the specialized search index in place of a standard MySQL query. This means all default search operations using the CMS search APIs for posts such as
get_search_form() and the REST API search endpoints will transparently make use of the search index.
The default Search index and related functionality is provided by the ElasticPress plugin.
Content that is indexed in the search index by default:
- Custom Post Types (registered with
- Post's Meta
- Post's Terms
- Post's Author
When used in conjunction with the Media Rekognition feature, all images are processed for automatic keyword detection and stored in the search index too.
All documents that are uploaded to the media library are also parsed and indexed. For example, if you upload a PDF file, the PDF content will be read and included in the search index. Searches for keywords and phrases that are included in the document will be then be included in search results.
The follow document types are parsed and their content is added to the search index:
To disable the indexing of document content, set the
modules.search.index-documents settings to
It is also possible to modify the specific fields stored for each post to provide extra search data that is not included by default. See Search Index Modification for details.
Elasticsearch is used to provide the search index, as such as a developer you can make direct use of Elasticsearch for advanced feature development. See Using Elasticsearch for details.