wallmanderco / elasticsearch-indexer
Elasticsearch indexer for WordPress and WooCommerce
Requires
- php: >=5.4.7
- elasticsearch/elasticsearch: ~1.0
Requires (Dev)
- fabpot/php-cs-fixer: 2.0.*@dev
README
A plugin that integrates WordPress with Elasticsearch.
Aside from super fast full text search, this plugin will speed up post listings of any post type, including WooCommerce products.
The plugin works by indexing all posts and post meta data and redirecting the requests by WordPress from MySQL to Elasticsearch.
The plugin requires that you have Elasticsearch installed on your server.
WordPress Repository: https://wordpress.org/plugins/elasticsearch-indexer/
Demo
- WooCommerce 10 000 products
- WooCommerce 10 000 products without elasticsearch
- WooCommerce 135 000 products
- WooCommerce 135 000 products without elasticsearch
Installing the plugin from GitHub
- Download the zip file from GitHub.
- Unzip and put the new directory inside you plugins directory (
/wp-content/plugins/
) in wordpress. - run
composer install
inside the new directory. - Install Elasticsearch if you haven't already.
- Make sure that Elasticsearch is installed and running on your server
(You can test this by runningcurl -XGET -i 'http://127.0.0.1:9200'
in the command line) - Activate the plugin in the wordpress admin panel.
- Click on the new menu item and press the button “Reindex all posts”.
Installing Elasticsearch
Follow the instructions in the Elasticsearch Docs.
Make sure that Elasticsearch is installed and running on your server by running curl -XGET -i 'http://127.0.0.1:9200'
in the command line.
Usage
The plugin requires no modification to work. Once you have put in your settings and run an initial reindex of the site the plugin will keep elasticsearch in sync with MySQL and redirect queries from MySQL to Elasticsearch. However the plugin comes with a few extra features and filters that you can use.
Not supported
- Sticky posts (ignores sticky posts. All wordpress queries will act as if
ignore_sticky_posts
is set totrue
) - Password protected posts (fallback to MySQL if used)
- Random sorting (ignored)
License
Elasticsearch Indexer is licensed under General Public License (GPLv2).