Skip to content

Backgrounds

How-to Guides

Technical References

Enterprise Search /

Enable Enterprise Search in code

This step enables Enterprise Search integration with the default allow lists.

Code changes required

Add the following constant defines to vip-config.php (the equivalent to adding them to wp-config.php):

define( 'VIP_ENABLE_VIP_SEARCH', true );
define( 'VIP_ENABLE_VIP_SEARCH_QUERY_INTEGRATION', true );

If you are indexing a multisite, add the below as well:

define( 'EP_IS_NETWORK', true );

These are the code changes required to have Elasticsearch (ES) index your content and offload standard (search) queries.

Note

Once you have enabled Enterprise Search in code, you will need to index!

Alternative Elasticsearch Components

Disable and remove all other Elasticsearch-backed functionality. If you previously used Jetpack Search, the es-wp-query adapter, or another variant of ES, you’ll also need to remove them, as no other Elasticsearch backed functionality is supported while Enterprise Search is enabled. Additionally, Enterprise Search uses forks of es-wp-query and ElasticPress that are loaded automatically.

If there are conflicts, PHP warnings or notices should be issued; check New Relic’s error logs for these.

If you are converting from standard WordPress search or Jetpack Search to WordPress VIP’s Enterprise Search, and your site is already live and serving traffic, you can avoid search downtime by enabling just Enterprise Search first (with the VIP_ENABLE_VIP_SEARCH constant), which will start indexing new, incremental changes without affecting Jetpack. Note: You will still need to run an index for the existing site content.

Continue to follow this guide in setting up your allow lists and indexes. Once those are ready and reporting good health, you can remove the Jetpack Search components noted above. Enabling VIP_ENABLE_VIP_SEARCH_QUERY_INTEGRATION will then send queries to Enterprise Search.

If you’re on a multisite, it’ll be easier and more reliable to set up all subsites at the same time. Also, we recommend reviewing our tips for multisites.

Last updated: September 09, 2021