Elasticsearch-powered APIs
We maintain Elasticsearch indices for all posts on WordPress.com and all posts synced through the Jetpack plugin.
These documents describe the index structures and the APIs you can query. The Jetpack Search API supports most of the Elasticsearch Query DSL, and the Related Posts API accepts Elasticsearch filters. For Jetpack Search plans and pricing, see Jetpack Search.
API availability
Two APIs query these indices:
- Jetpack Search: Sites that use Jetpack Search are indexed into our global Elasticsearch cluster, and you can query them with the Jetpack Search API. We support most of the Elasticsearch Query DSL, but not all of it.
- Related Posts: All sites are indexed to power Related Posts. The Related Posts API accepts custom Elasticsearch filters.
Elasticsearch versions and backwards compatibility
The Elasticsearch project is focused on continually improving its APIs and so regularly breaks backwards compatibility. Our APIs strive to maintain backwards compatibility and so there are a number of features that we choose not to support for various security or performance reasons. For example, all scripting is disabled in our API. We also do not try and use the very latest version of Elasticsearch because we are committed to backwards compatibility.
Our query API looks mostly like the Elasticsearch Search API from version 2.4 of Elasticsearch. We do however accept some deprecated features and perform some query rewriting to maintain compatibility. A good example is when we moved from ES 1.x to 2.x all content had to be migrated from being stored in the “content” field with multiple analyzers to being stored in a separate field for each language analyzer: “content.en”, “content.fr”, “content.default”, etc. We rewrite queries that still use the “content” field.
Existing libraries
There likely will be times where we have to break backwards compatibility (in hopefully minor ways). The best way to ensure your application will not run into these issues is to use one of the existing libraries or filters rather than writing a completely custom search query:
- Jetpack Related Posts filter hooks.
- Jetpack Search filter hooks.
- Jetpack Search query parser (abstraction layer).
- Jetpack Search query builder (abstraction layer).
- es-wp-query converts WP_Query MySQL queries to Elasticsearch queries. It’s untested with the Jetpack Search API and may work only in part.
- es-admin powers the wp-admin post search with Elasticsearch. It’s untested with the Jetpack Search API.
Because code makes the best documentation, how the mappings and documents are built for our indices is mostly available in WPES-Lib. Data.blog has the best description of how our real time indexing works.
Documents
We index WordPress posts, pages, and custom post types. Posts that are blocked from syncing through Jetpack aren’t indexed.
See the post document schema for details on all fields in the index.
Search API
The Jetpack Search API and the Related Posts API support different parts of the Elasticsearch Query DSL.
See Elasticsearch queries for the queries, filters, and aggregations each API supports, and their limits.
* Elasticsearch is a trademark of Elasticsearch BV, registered in the U.S. and in other countries.
Last updated: December 02, 2026