manifest / integrations / elasticpress-stopwords
ElasticPress Stop words extension
WordPress plugin to integrate WordPress stopwords with ElasticPress mapping.
★ 4stars
3.4kcomposer installs
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/humanmade/elasticpress-stopwords/archive/refs/heads/main.zipOn Packagist as humanmade/elasticpress-stopwords:
composer require humanmade/elasticpress-stopwordsNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
|
ElasticPress Stopwords Integrates WordPress stopwords and filters with ElasticPress mapping. |
|
| A Human Made project |
ElasticPress stopwords allows developers to customize stopwords functionality of Elastic through linking ElasticPress mapping with WordPress default stopwords list and using related filter wp_search_stopwords.
Requirements
- PHP >= 7.1
- WordPress >= 5.3
- ElasticPress >= 3.4.3 (not tested with older versions)
Getting Set Up
Install Using Composer
composer require humanmade/elasticpress-stopwords
Load the plugin
require_once __DIR__ . '/vendor/humanmmade/elastic-stopwords/plugin.php';
Once you've installed the plugin, use the following code to manage stopwords:
add_filter( 'wp_search_stopwords', function( array $stopwords ) : array {
$words_to_remove = [ 'foo' ];
$words_to_add = [ 'bar' ];
return array_merge( array_diff( $stopwords, $words_to_remove ), $words_to_add );
} );
Credits
Created by Human Made with :heart:
Written and maintained by Shady Sharaf.
Interested in joining in on the fun? Join us, and become human!