Several features built into Enterprise Search can be enabled with the
wp vip-search activate-feature command using VIP-CLI.
vip @<app-alias>.<env> -- wp vip-search activate-feature <feature-slug>
To disable a feature, use the
vip @<app-alias>.<env> -- wp vip-search deactivate-feature <feature-slug>
In a multisite context, features are enabled or disabled on a per-network site basis. They cannot be toggled on a global network basis. For example, if a multisite has two sites ID 1 and ID 2, and the
protected_content feature is enabled for site ID 1, it will not be enabled for site 2.
VIP-CLI command examples
For demonstration purposes, the
mytestsite and the
develop are used in the VIP-CLI command examples below. Read more about how to target environments in VIP-CLI commands.
When enabled, the Facets feature adds an ElasticPress Facets widget to the list of available widgets in the WordPress Admin. The Facets widget displays term aggregations in a sidebar or any widgetized area. The taxonomies included in aggregations must be code configured.
To enable indexing of non-public content (private post types and statuses) and send all non-AJAX WordPress admin queries to Elasticsearch, this feature must be activated. Once activated, a re-index (or versioning) will be necessary.
Once enabled, there is a risk of exposing non-public content to unauthorized users. Test all queries carefully.
vip_es_get_related_posts helper function returns related posts on a post ID. By default, the related posts feature will not function for custom post types, even if the custom post type is indexed. It is possible to return related posts for custom post types via custom code.
Queries with an
s parameter will be automatically sent to Elasticsearch and searched against
post_excerpt. This is highly beneficial because the default MySQL behavior, fulltext search with
LIKE clauses, can result in poor database performance.
To prevent this behavior and force the query to go to MySQL, set both the
ep_integrate WP_Query parameters to false.
search feature is deactivated, search will not be offloaded to Enterprise Search. Deactivating
search is not recommended and can result in negative impact to a site’s performance.
This feature allows for the customization of results returned on search terms, where results can be manually added or re-ordered. After this feature is enabled, custom search results can be configured in the site’s WordPress Admin dashboard. Access the customization panel be selecting Enterprise Search > Custom Results in the lefthand navigation menu.
Activating this feature enables the terms Indexable.
terms feature is activated, enable the mapping (via the
--setup flag) and index just the terms:
$ vip @mytestsite.develop -- wp vip-search index --indexables=term --setup ⚠️ You are about to run a destructive operation. Are you sure? [y/n] y Indexing with setup option needs to delete Elasticsearch index first, are you sure you want to delete your Elasticsearch index? [y/n] y Adding term mapping... Success: Mapping sent Indexing terms... Processed 1/1. Last Object ID: 1 Number of terms indexed: 1 Total time elapsed: 0.504 Success: Done!
Activating this feature enables the users Indexable.
users feature is activated, enable the mapping (via the
--setup flag) and index just the users:
$ vip @mytestsite.develop -- wp vip-search index --indexables="user" --setup ⚠️ You are about to run a destructive operation. Are you sure? [y/n] y Indexing with setup option needs to delete Elasticsearch index first, are you sure you want to delete your Elasticsearch index? [y/n] y Adding user mapping... Success: Mapping sent Indexing users... Processed 1/1. Last Object ID: 1 Number of users indexed: 1 Total time elapsed: 0.170 Success: Done!
When enabled, the WooCommerce feature will run all critical WooCommerce queries through Elasticsearch instead of MySQL making it possible to render pages and process complex ecommerce filters very fast.
Last updated: September 11, 2023