Skip to content

Enterprise Search

Enterprise Search was developed by WordPress VIP to expand the usage of Elasticsearch, providing both a search solution and a performance-enhancing layer to existing WordPress searches and queries.

In Enterprise Search, a fork of ElasticPress provides Elasticsearch indexing and search, and a fork of es-wp-query provides query offloading capabilities via an Enterprise Search adapter.

The Enterprise Search feature is enabled via code and its features can be enabled by VIP-CLI. Enterprise Search indexes can be indexed and versioned with VIP-CLI. Search Dev Tools and the VIP-CLI health command are available to assist with debugging and troubleshooting.

Enterprise Search can be enabled in a VIP Local Development Environment.

Limitations

  • VIP does not provide a public endpoint for running searches. Enterprise Search relies on a secure API to provide a powerful set of capabilities. Therefore, Elasticsearch results are rather raw, and VIP does not recommend attempting to proxy the search results.
  • Currently, the ElasticPress features Instant Search, Documents, and Autosuggest cannot be enabled for Enterprise Search.
  • Enterprise Search can only return the first 10000 documents from a search query. This is a standard limitation put in place to protect the performance and memory usage of an Elasticsearch instance. If a search query attempts to retrieve more than 10000 documents, the query for the additional documents will use a regular database query instead of Elasticsearch. This limitation applies even if the search results are paginated. For example, a query for only 16 documents will not be run against Elasticsearch if they do not exist within the first 10000 documents.
  • A default character length limit of 255 is applied to users with an edit_posts capability and 80 for users without. The vip_search_char_length() filter can be used to modify these limitations to a character limit between 0-255.
  • Data sync only copies production data to a non-production environment. It does not create, affect, or modify any Elasticsearch indexes in the target non-production environment. The target environment’s Elasticsearch indexes must be created or versioned following the data sync.
  • _doing_it_wrong() calls are used throughout the Enterprise Search code to throw configuration warnings.
  • VIP applies rate limiting to protect the search services from instability caused by spikes in requests.
  • To query for and obtain post data (i.e. search results) in JSON format directly from a browser or other client via an AJAX request, a custom, cacheable, API adapter route should be built to limit the types of queries that can be made, and use only the post IDs from the raw Elasticsearch results. Any other details from Elasticsearch should not be used for constructing a user interface. To obtain any additional post or comment details from WordPress (e.g. post title, URL, etc.), use WordPress’s built-in data access functions.

Last updated: August 03, 2023

Relevant to

  • WordPress