PHPackages                             alleyinteractive/searchpress - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. alleyinteractive/searchpress

ActiveWordpress-plugin[Search &amp; Filtering](/categories/search)

alleyinteractive/searchpress
============================

Elasticsearch integration for WordPress.

v0.6(1y ago)851.0k—0%10[48 issues](https://github.com/alleyinteractive/searchpress/issues)[9 PRs](https://github.com/alleyinteractive/searchpress/pulls)1GPL-2.0-or-laterPHPCI failing

Since Sep 25Pushed 5mo ago47 watchersCompare

[ Source](https://github.com/alleyinteractive/searchpress)[ Packagist](https://packagist.org/packages/alleyinteractive/searchpress)[ RSS](/packages/alleyinteractive-searchpress/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (2)Versions (18)Used By (1)

SearchPress
===========

[](#searchpress)

[![SearchPress](https://user-images.githubusercontent.com/465154/116134994-887eff80-a69e-11eb-8e6a-cd7c51a9a5eb.png)](https://user-images.githubusercontent.com/465154/116134994-887eff80-a69e-11eb-8e6a-cd7c51a9a5eb.png)

Elasticsearch integration for WordPress.

Release Information
-------------------

[](#release-information)

Each stable release gets tagged and you can [download releases from GitHub](https://github.com/alleyinteractive/searchpress/releases). `master` points to the latest stable release at any given time.

### Pre-Release Versions

[](#pre-release-versions)

Pre-release development happens against `release/` branches. Once a release is ready-to-ship, it is merged into `master` and tagged.

### Backwards Compatibility &amp; Breaking Changes

[](#backwards-compatibility--breaking-changes)

We try to maintain backwards compatibility as much as possible. It's possible that releases will need to contain breaking changes from time to time, especially as Elasticsearch itself is a constantly changing product. Breaking changes will be detailed in release notes.

SearchPress has a thorough battery of unit and integration tests to help add compatibility with each new Elasticsearch release, without compromising compatibility with older releases.

Prerequisites
-------------

[](#prerequisites)

- [Elasticsearch](https://www.elastic.co/elasticsearch): 6.8+
- PHP: 7.4+
- WordPress: 5.9+

Setup
-----

[](#setup)

1. Upload to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. You'll be prompted to add your Elasticsearch endpoint and to index your posts
    - SearchPress provides a WP-CLI command for faster indexing on large sites
4. Once indexing is complete, you're good to go!

Indexing Post Meta
------------------

[](#indexing-post-meta)

In early versions of SearchPress, SearchPress would index almost all post meta with the post. Starting in the 0.4 release, SearchPress only indexes the post meta that it is explicitly told to index. Further, it only indexes post meta in the *data types* that a site's developer plans to use. The principal reason behind this change is performance, and to prevent ["mappings explosion"](https://www.elastic.co/guide/en/elasticsearch/reference/master/mapping.html#mapping-limit-settings).

Data type casting will only be attempted for a key if the opt-in callback specifies that type for the key in question (see example below for the full list of possible types). However, the data type will still only be indexed if the type casting is successful. For example, attempting to index the meta value `"WordPress"` as a `long` would fail, since it is not a numeric value. This failure is silent, for better or worse, but type casting is overall quite forgiving.

If a meta key is allowed to be indexed, the meta value will *always* be indexed as an unanalyzed string (`post_meta.*.raw`) and that type need not be specified. This is primarily for compatibility with [ES\_WP\_Query](https://github.com/alleyinteractive/es-wp-query), which depends on that key in `EXISTS` queries, among others.

### How to index post meta

[](#how-to-index-post-meta)

```
add_filter(
    'sp_post_allowed_meta',
    function( $allowed_meta ) {
        // Tell SearchPress to index 'some_meta_key' post meta when encountered.
        $allowed_meta['some_meta_key'] = [
            'value',    // Index as an analyzed string.
            'boolean',  // Index as a boolean value.
            'long',     // Index as a "long" (integer).
            'double',   // Index as a "double" (floating point number).
            'date',     // Index as a GMT date-only value in the format Y-m-d.
            'datetime', // Index as a GMT datetime value in the format Y-m-d H:i:s.
            'time',     // Index as a GMT time-only value in the format H:i:s.
        ];
        return $allowed_meta;
    }
);
```

Changelog
---------

[](#changelog)

### 0.6

[](#06)

- **POSSIBLE BREAKING CHANGE** Refactors `SP_Heartbeat` to store the last time the beat was checked as well as the last time the beat was verified. `SP_Heartbeat::get_last_beat()` previously returned an int, but now returns an array.
- Includes assorted improvements for IDE static analysis.

### 0.5.1

[](#051)

- Adds `sp_api_request_url` filter to filter the API url.
- Fixes indexing error when using SP\_DEBUG
- Fixes possible fatal where 'sp' is set as a query\_var but is not an array
- Fixes CLI display of page size when page size is greater than 999

### 0.5

[](#05)

- **POSSIBLE BREAKING CHANGE**: Moves SearchPress integration to the `posts_pre_query`.
- Adds UI for authentication
- Trims trailing slashes from ES host value
- Adds the `sp_search_uri` filter
- Addresses phpcs issues
- Disables flush via UI
- Adjusts empty-string search integrations
- Filters the log message for the error
- Adds support for pasing an array of terms in SP\_WP\_Search
- Cleans up inline documentation
- Adds the `sp_request_response` action hook to the `SP_API` class

### 0.4.3

[](#043)

- Manually check for queried taxonomy terms when building facets
- Adds support for Github Actions
    - Tests action for PHPCS
    - Tests action for unit tests
- Removes double underscore for single to fix PHP warning
- Updates phpunit
- Adds support for ES 8.x
- Adds support for PHP 8.1, 8.2

### 0.4.2

[](#042)

- CLI improvements
    - Improves PHPDoc
    - Adds more CLI command examples
    - Adds more standards from
    - Uses WP\_CLI::log instead of WP\_CLI::line
    - The debug command checks for the existence of a valid post and adds a warning for SP\_DEBUG and SAVEQUERIES
    - Uses WP\_CLI\\Utils\\get\_flag\_value to get flag values
    - Uses quote instead of double quotes
    - Adds support for --post-types argument

### 0.4.1

[](#041)

- Updates grunt packages to latest versions
- Documents deprecated/removed filters in 0.4.0
- Improves handling of indexing batch with no indexable posts
- Adds filter `sp_post_index_path` for single post paths
- Adds filter `sp_bulk_index_path` for bulk index paths

### 0.4

[](#04)

- **CRITICAL BREAKING CHANGE:** Post meta indexing is now opt-in. See README for more information.
- **POTENTIAL BREAKING CHANGE:** Removes `sp_post_indexable_meta` filter
- Removes `sp_post_ignored_postmeta` filter
- Adds support for ES 5.x, 6.x, 7.x
- Fixes indexing bug with parentless attachments
- Fixes a bug with bulk syncing attachments
- Improves flexibility for custom indexing of posts
- Improves facet lists to exclude current selections
- Adds option in the admin to index content without flushing
- Fixes bug with cached list of post types to sync
- Fixes conflicts with Advanced Post Cache and CLI-based cron runners
- Adds completion suggester API for search-as-you-type functionality
- Fixes bug with SSL cert verification
- Overhaul of phpunit testing environment for performance
- General coding standards cleanup

### 0.3

[](#03)

- Adds heartbeat to monitor Elasticsearch
- Improves capabilities handling for admin settings
- Adds a status tab to admin page
- Improves test coverage for heartbeat and admin settings
- Fixes bug with post type facet field
- Allows multiple post IDs to be passed to cli index command
- Locally cache API host to improve external referencing to it
- Fixes edge case bugs with indexing, e.g. with long meta strings
- Improves indexed/searched post types and statuses handling
- Tests across a wider range of ES versions using CI
- Stores/checks mapping version
- General code improvements

### 0.2

[](#02)

- Adds unit testing
- Significant updates to mapping *(breaking change)*
- Enforce data types when indexing
- Adds helper functions
- Adds support for ES 1.0+ *(breaking change)*
- Refactors search *(breaking change)*
- Removes SP\_Config::unserialize\_meta()
- Adds Heartbeat to automatically disable the integration if ES goes away
- Update to latest WP Coding Standards
- Assorted bug fixes

### 0.1

[](#01)

- First release!

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance49

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community29

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 69.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~526 days

Recently: every ~117 days

Total

7

Last Release

412d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d2679da8ee30c4d7eae16ffd2271484027b3b27be6d7fb8202d5e4c6d210881d?d=identicon)[alleyinteractive](/maintainers/alleyinteractive)

---

Top Contributors

[![mboynes](https://avatars.githubusercontent.com/u/465154?v=4)](https://github.com/mboynes "mboynes (410 commits)")[![renatonascalves](https://avatars.githubusercontent.com/u/19148962?v=4)](https://github.com/renatonascalves "renatonascalves (48 commits)")[![timatron](https://avatars.githubusercontent.com/u/675393?v=4)](https://github.com/timatron "timatron (24 commits)")[![kevinfodness](https://avatars.githubusercontent.com/u/2650828?v=4)](https://github.com/kevinfodness "kevinfodness (24 commits)")[![alexisbellido](https://avatars.githubusercontent.com/u/305270?v=4)](https://github.com/alexisbellido "alexisbellido (23 commits)")[![srtfisher](https://avatars.githubusercontent.com/u/346399?v=4)](https://github.com/srtfisher "srtfisher (19 commits)")[![jakewrfoster](https://avatars.githubusercontent.com/u/1018205?v=4)](https://github.com/jakewrfoster "jakewrfoster (17 commits)")[![mogmarsh](https://avatars.githubusercontent.com/u/11542164?v=4)](https://github.com/mogmarsh "mogmarsh (16 commits)")[![mslinnea](https://avatars.githubusercontent.com/u/7308162?v=4)](https://github.com/mslinnea "mslinnea (3 commits)")[![ethitter](https://avatars.githubusercontent.com/u/321503?v=4)](https://github.com/ethitter "ethitter (2 commits)")[![kjbenk](https://avatars.githubusercontent.com/u/5174208?v=4)](https://github.com/kjbenk "kjbenk (2 commits)")[![benpbolton](https://avatars.githubusercontent.com/u/7146063?v=4)](https://github.com/benpbolton "benpbolton (2 commits)")[![bcampeau](https://avatars.githubusercontent.com/u/966849?v=4)](https://github.com/bcampeau "bcampeau (2 commits)")[![moraleida](https://avatars.githubusercontent.com/u/1174547?v=4)](https://github.com/moraleida "moraleida (1 commits)")

---

Tags

elasticsearchwordpresswordpress-pluginpluginsearchwordpressperformancefaceted searchsearchpress

### Embed Badge

![Health badge](/badges/alleyinteractive-searchpress/health.svg)

```
[![Health](https://phpackages.com/badges/alleyinteractive-searchpress/health.svg)](https://phpackages.com/packages/alleyinteractive-searchpress)
```

###  Alternatives

[10up/elasticpress

Supercharge WordPress with Elasticsearch.

1.3k395.7k17](/packages/10up-elasticpress)[webdevstudios/cmb2-post-search-field

Custom field for CMB2 which adds a post-search dialog for searching/attaching other post IDs.

6648.5k2](/packages/webdevstudios-cmb2-post-search-field)[10up/debug-bar-elasticpress

Extends the Debug Bar plugin for usage with ElasticPress

2917.5k](/packages/10up-debug-bar-elasticpress)[tpwd/ke_search

Faceted search - Search Extension for TYPO3, including faceting search functions.

15926.5k18](/packages/tpwd-ke-search)[mezcalito/ux-search

Effortless search and faceted search with Symfony UX and Mezcalito UX Search

6612.7k2](/packages/mezcalito-ux-search)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
