InMotion Hosting Support Center

If you've ever used Elasticsearch for managing your searchable content, you know that it is incredibly fast and scalable. If you're a WordPress user, you likely also know that obtaining WP_Query objects can sometimes have a negaitve impact on your resource usage if you have a large database of center to search from. Thankfully, 10up has developed a solution in which the WP_Query object can use Elasticsearch instead of the default behavior, which is much easier on your server resources.

In this article, we will show you how to integerate WordPress with Elasticsearch using ElasticPress by 10up.

Note: This article assumes that you have already installed Elasticsearch. If you have not already done so, you may review our article on installing Elasticsearch.

This ElasticPress also requires WP-CLI. If you don't already have it installed, you may follow our article on installing WP-CLI.

  1. First, you will need to edit your wp-config.php file to include the location of your Elasticsearch server. In this example, Elasticsearch is on the same server as our WordPress site, so we add the following:

    define( 'EP_HOST', 'http://127.0.0.1:9200' );

    If you need help doing so, you may review our article on editing your wp-config.php file.

  2. Next, you will need to install the ElasticPress plugin. The ElasticPress plugin is available both within the WordPress plugin directory, or within GitHub. If you want the most updated version, we recommend GitHub.

    If you need help, you may review our article on installing the ElasticPress plugin.

  3. Of course, Elasticsearch isn't doing us any good if we don't have any data populated within it. To begin, log into your server via SSH and execute one of the following:

    For single WordPress sites

    wp elasticpress index --setup

    For cross-site search on multisite

    wp elasticpress index --setup --network-wide

ElasticPress is now running on your site and all searches are now WP_Query is now handling searches with Elasticsearch instead of running MySQL queries for your data. For more information on ElasticPress, check out the ElasticPress GitHub page.

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

Social Media Login

   
Social Login Joomla

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

0 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!