Instant Results

Stopwatch

Instant Results is a powerful feature designed to dramatically improve search speed on your WordPress site. Instead of routing queries through WordPress’s default search process — which can be slow and resource-intensive — Instant Results sends search queries directly to ElasticProbe’s servers. In this post we will review the setup process and have an in-depth look at the mechanics of Instant Result.

 

Instant results modal

Enabling Instant Result in the plugin

  • Log into your WordPress admin area (e.g., https://yourdomain.tld/wp-admin).
  • Locate ElasticProbe in your list of installed plugins from the sidebar and click on it.
  • Navigate to the Instant Results and enable it.
  • Choose the Highlighting HTML Tag: From the Highlight tag dropdown, select the HTML element that will wrap the highlighted terms. Choosing the right tag depends on how you want the terms to appear visually and how your site’s CSS is structured (Read more in Highlighting section below). Options include:
    • <span> — recommended for advanced styling via CSS.
    • <em> — default browser styling usually renders text in italics.
    • <strong> — displays highlighted terms in bold.
    • <i> – Adds italic styling for visual effect without implying emphasis.
  • Select appropriate filter tags and suggestions: for more information see Filters and search suggestions sections below.
  • Click Save Changes to apply your newly configured settings.

Note1: The Instant Results shows the search results in a modal that inherits your theme’s styles. You can further customize the look and feel by changing CSS.

Note2: A full sync is required after toggling the feature for it to take effect.

Instant Results UI

Highlighting

Instant results can highlight the search query. The options are <em>, <i>, <span>and<strong>. The <span> tag can be a safe choice and is generally easier to customize the look and feel of the highlighted section. All highlighted texts will have the ep-highlight CSS class.

Note: Enabling highlighting has a small impact on the search speed.

Filters

By default when a search is performed, filters appear alongside the results. These filters can include Wordpress taxonomies (including custom ones), post types or Woocommerce price ranges. Users can show or hide filters by selecting or deselecting them.

The Match type will dictate the plugins behavior when multiple filters are selected by the user.

The Filter count displays the number of matching posts available for each filter.

Search suggestions

When no search results are found, search suggestions will be displayed if the Did you mean feature is enabled.

In-depth Instant results

In a typical Wordpress search with ElasticProbe enabled and Instant Results disabled the following events chronologically will occur behind the scene:

  1. The browser requests a search results page.
  2. Wordpress sends the search query to ElasticProbe (or designated ElasticSearch instance)
  3. ElasticProbe sends the search results to Wordpress
  4. Wordpress uses the search results to render the search results page.

In this setup most of the time is spent at step 4. This step contains running all the page load logic in the Wordpress core, activated theme and activated plugins. Speed wise, the performance of ElasticProbe or ElasticSearch instance is not very important when Wordpress is slower by an order of magnitude.

Enter Instant Results. This feature completely removes Wordpress from the search process by doing AJAX requests to ElasticProbe directly and showing the results in a modal. This feature lowers the steps required to the following:

  1. User sends a search query to ElasticProbe servers.
  2. The server responds with the results.

In practice, there is an additional step when Wordpress admin enables Instant Result. In this step the search template is sent to the server but this is a one time event and does not repeat for each user’s search query.

Note: Instant Results require custom backend APIs, therefor it is only available to ElasticProbe customers and it can’t be activated on ElasticSearch instances.