Transition from Jetpack Search to Enterprise Search
Sites that are currently using Jetpack Search can transition to using Enterprise Search instead.
By following the steps outlined below, sites that are currently using Jetpack Search—and already launched and serving traffic—can avoid search downtime.
Enable Enterprise Search
- Enabling Enterprise Search by adding the
VIP_ENABLE_VIP_SEARCH
constant tovip-config.php
and defining it astrue
. This will initiate the indexing of new, incremental changes without affecting Jetpack Search. - Run an index for the existing site content.
- If needed, create allow lists to define what is indexed.
- Verify that the newly created index is reporting good health and test search queries.
It is recommended to look for any usages of the filters jetpack_search_es_wp_query_args
or jetpack_search_es_query_args
in the codebase and modify them to use the equivalent ep_formatted_args_query
or ep_formatted_args
. Because the Elasticsearch queries are not 1:1 for Jetpack and Enterprise Search, any alterations that are made should be tested.
Transition to Enterprise Search
Once it is determined that the site is ready to transition off of its current Elasticsearch service into Enterprise Search.
- Add the
VIP_ENABLE_VIP_SEARCH_QUERY_INTEGRATION
constant tovip-config.php
and define it astrue
. This will automatically send front-end search queries directly to Enterprise Search and disable the Jetpack Search module. - Verify that Enterprise Search is sending its queries to Elasticsearch by using Search Dev Tools.
- Disable and remove all other Elasticsearch-backed functionality such as Jetpack Search, the es-wp-query adapter, or other variants of Elasticsearch. Enterprise Search uses forks of es-wp-query and ElasticPress that are loaded automatically. No other Elasticsearch-backed functionality can be supported while Enterprise Search is enabled.
- If application code was added to make search endpoint calls to the WordPress.com public API (e.g.
https://public-api.wordpress.com/rest/v1/sites/<site ID>/search
), modify the code to use the WordPress core REST API instead. For example:https://example.com/wp-json/wp/v2/search?search=<search term>
.
After transitioning to Enterprise Search, refer to debugging tools such as Query Monitor, Runtime Logs, and New Relic’s error logs for conflicts, PHP warnings or issued notices.
Jetpack migration support path
define( 'VIP_SEARCH_MIGRATION_SOURCE', 'jetpack' );
For sites that are using the jetpack_sync_post_meta_whitelist
filter, the constant VIP_SEARCH_MIGRATION_SOURCE
can be added to vip-config.php
and defined as jetpack
. Jetpack’s default post meta allow list, and the values that are being filtered will be used as a base in the post meta allow list.
Last updated: November 07, 2023