diff --git a/000-vip-init.php b/000-vip-init.php index dce6df9fa4..4897b83cdf 100644 --- a/000-vip-init.php +++ b/000-vip-init.php @@ -280,6 +280,9 @@ if ( ( defined( 'USE_VIP_ELASTICSEARCH' ) && USE_VIP_ELASTICSEARCH ) || // legacy constant name ( defined( 'VIP_ENABLE_VIP_SEARCH' ) && true === VIP_ENABLE_VIP_SEARCH ) ) { require_once __DIR__ . '/search/search.php'; + if ( ! defined( 'VIP_SEARCH_ENABLED_BY' ) ) { + define( 'VIP_SEARCH_ENABLED_BY', 'constant' ); + } } // Set WordPress environment type diff --git a/config/class-site-details-index.php b/config/class-site-details-index.php index bd3dd2f1ff..022ddcd402 100644 --- a/config/class-site-details-index.php +++ b/config/class-site-details-index.php @@ -260,10 +260,12 @@ public function get_search_info() { $search_info['enabled'] = true; $search_info['query_integration_enabled'] = \Automattic\VIP\Search\Search::is_query_integration_enabled(); $search_info['network_enabled'] = defined( 'EP_IS_NETWORK' ) && true === constant( 'EP_IS_NETWORK' ); + $search_info['enabled_by'] = defined( 'VIP_SEARCH_ENABLED_BY' ) ? constant( 'VIP_SEARCH_ENABLED_BY' ) : 'unknown'; } else { $search_info['enabled'] = false; $search_info['query_integration_enabled'] = false; $search_info['network_enabled'] = false; + $search_info['enabled_by'] = false; } return $search_info; diff --git a/integrations/enterprise-search.php b/integrations/enterprise-search.php index 39b5ab4e02..d1ad2d6234 100644 --- a/integrations/enterprise-search.php +++ b/integrations/enterprise-search.php @@ -44,6 +44,10 @@ public function load(): void { } else { require_once __DIR__ . '/../search/search.php'; } + + if ( ! defined( 'VIP_SEARCH_ENABLED_BY' ) ) { + define( 'VIP_SEARCH_ENABLED_BY', 'integration' ); + } } /**