Skip to content

How-to Guides

Technical References

Elasticsearch /

Elasticsearch options and debugging

Debugging Elasticsearch

The Debug Bar on VIP sites includes an Elasticsearch panel which provides details on all queries performed on the page, including the full JSON-based query sent to the index, timing data (how fast was the query, the network request, etc.), and so on. This can be incredibly useful when things aren’t working as expected.

Replacing WP_Query

We also support other advanced use cases with Elasticsearch outside of search like offloading expensive queries.

You can use the es-wp-query plugin from Alley Interactive to offload any WP_Query lookup to Elasticsearch for the increased performance of a variety of workloads. Use of the plugin is as simple as adding ’es’ => true to your query params when building the WP_Query object.

While Elasticsearch does generally speed up most queries, there may be cases where Elasticsearch may actually be slower. This depends on various factors like the speed of the original MySQL query (using a primary key like ID or an index), the complexity of the Elasticsearch query, cost of the network round-trip, and so on. Query times and complexity should be carefully measured before deciding to offload.

Search API

You can send fully qualified Elasticsearch queries directly to the API as well:

curl${SITEID_OR_URL}/search --data '{"query": { "term": { "title": "elasticsearch" } } }'

Where ${SITEID_OR_URL} should be replaced with your site’s ID or the site URL.

Querying multiple sites

Searching across sites is not currently supported via Jetpack Search but it’s something we’re interested in exploring. If this is functionality that you are interested in, please let us know.

Non-Public Content

To search for non-public content, you can make authenticated requests to the API. This can be done by filtering the Elasticsearch arguments. We recommend doing so via client-mu-plugins:

add_filter( 'jetpack_search_es_query_args', function( $es_query_args ) {
 $es_query_args['authenticated_request'] = true;

 return $es_query_args;
} );

This will make an authenticated (as your JP site) request to the Elasticsearch API, which provides access to non-public content.

Admin search

We’re exploring ways to add Jetpack Search capabilities to the admin to allow for faster and more relevant searches for editorial teams. Stay tuned for more.


To learn more about how content from your WordPress site is mapped to the Elasticsearch index, please see

The code that handles the mapping/translation can be found here:

Last updated: October 16, 2020