By default, Enterprise Search will not index every post type, taxonomy, or meta. You will need to identify and create allow lists for the below items that should be indexed and made available for search:
Posts indexed by default
All of the published public post types and their public taxonomy terms will be indexed.
Indexing Private Content
To enable indexing of all private post types and statuses, the Protected Content feature must be activated:
vip @mysite.production -- wp vip-search activate-feature protected_content
Index only what is necessary for searches
Not all site content is necessary to be indexed. Indexing content not used in searches can result in:
- additional time required for modification events or versioning during indexing
- unnecessary items occupying space in the index
- search results polluted by less relevant content
Typically, the only taxonomy, meta, or post types that should be indexed are those used as criteria in actual queries or searches (for example, in a
WHERE clause or used for sorting).
Conduct an audit in code
A good starting approach would be to audit any custom queries or query modifications in use and identify in those queries the post type(s), the taxonomies, and post meta that may be involved.
For example, there is a custom user interface that handles updating content and a custom, filterable, event search page that allows the user to find events for a week when they’ll be in a particular city. Depending on how you’ve organized your code, you may approach these allow lists in two different ways:
- Search Centralized
Use one file specifically for search, as a must-use plugin, which defines each allow list. It is used for making adjustments to search configurations.
- Feature Centralized
Separate each feature, so all the code associated with events is in one directory, set of classes, or a plugin. The indexing for the events will be defined in the code associated with the feature, where the
register_taxonomy is already declared for these.