Back to Top

Elasticsearch for WooCommerce

Updated 7 November 2024

Elasticsearch for WooCommerce: We all know the concept of a Simple Search process of an online E-Commerce store, isn’t it?

Therefore, we can consider Elasticsearch as just an extended version of a simple search.

It incorporates various search conditions that can be added as per the site’s requirement and consequently, it has an edge over a simple search.

If you require expert assistance or want to develop custom unique functionality, hire WooCommerce Developers for your project.

In light of the above, Elasticsearch for WooCommerce is one of its kind, serving the WooCommerce sites with its enhanced search approaches.

Start your headless eCommerce
now.
Find out More

It incorporates the Simple-Match Query and Multi-Match Query for search scenarios. This defines the kind of search that will execute at the front end when a customer hops in to search for a product(s).

Spell checks, language stemmers, or replace/removing unnecessary characters from search input data, are some of the imperative features of the Elasticsearch for WooCommerce plugin.

As Elasticsearch help manage a large amount of data, it helps retrieve the searched data without any time lag.

Thus we can expect a great user experience, which shall surely generate real sales, hence a good amount of revenue generation for the site.

Note:

  • In the first place, one must install the Elastic Search Engine which must be running.
  • One must install composer on their servers; else follow the given instruction to install composer- Composer Installation.
  • Also, it does not allow or support third-party custom search; it works for only WooCommerce/ WordPress searches.
  • Elasticsearch for WooCommerce is compatible with the “8.7.1” version of Elasticsearch.
  • We provide a production version of the plugin. If you want a development version then you can get it at an additional cost. Please contact [email protected] for it. 

Watch the below video tutorial to understand the plugin workflow:

 

Features

  • The admin has the leverage to update products or pages data on the elastic server.
  • As per the Index Type, the data is stored on the elastic server. 
  • The admin can set Cron for Index Management as daily, weekly or monthly basis, which updates the changes, accordingly.
  • The search type can be chosen as Multi-Match Query or Simple Match Query to process a search. 
  • In the case of Multi-Match Query, the customer can process a search based on name, SKU, description, and a short description of the Product.
  • The spell correction feature automatically corrects the keywords if they are typed incorrectly by the customer.  
  • A synonym list which the admin defines simplifies the search process for the customers. 
  • Search filters such as Lowercase, Stop Words, Synonym List, Html Strip char Filter, Mapping Filters, or Pattern Replace Filter are chosen by the admin. 
  • The character filters help replace or even remove the unnecessary characters from the customer’s search input stream.
  • The admin can choose Language Stemmer according to the default language of the store.

Installation

The user will get a zip file that needs to be uploaded in the “Add New” menu option in the WordPress admin panel.

For this login to WordPress Admin Panel and in the Dashboard hover your mouse over the “Plugins” menu option select the “Add New” option.

add plugin

After this, the user will see an “Upload Plugin” option at the top of the page, click the option to upload the zip file.

upload plugin

On clicking the “Upload Plugin” option, the user will see a “Choose File” button. Click on the button to browse for the zip file as per the image below.

choose file

After browsing the file, click on the “Install Now” button to install the plugin as per the snapshot.

installation_zip

Once the user installs the plugin, the user can activate the plugin. The user needs to click on the “Activate Plugin” button to activate the plugin.

activate plugin

After activating the plugin, the below-mentioned command must be run in the respective directory (domain/wp-content/plugins/wp-woocommerce-elastic search) via terminal. 

Also, discover various solutions to add more features and enhance your online store by visiting the WooCommerce plugins.

command-

composer install

Setting up Configurations: Elasticsearch

Once the installation process is complete, the admin must navigate to the Elastic Search which is present in the admin panel as shown in the image below. 

Under the Settings tab, the admin has to configure the-
  • General Settings,
  • Search Settings, and
  • Set Cron for Index Management. 

General Settings

Firstly, under the settings tab, the admin has to configure the General settings. The admin sets the configurations for fields such as Host, Port, Index Prefix, etc. 

wpdemo.webkul.com_woocommerce-elastic-search-103-80-65-178_wp-admin_admin.php_pagewkwces-settingsasd-1

The admin configures the General Settings as under: 

Host: The host or website on which the admin wishes to configure the elastic search.  

Port Number: The number of ports to establish a connection with the elastic server.

Index Prefix: The admin defines a specific index prefix, While reindexing if we are using an elastic search on multiple websites it does not affect the data on other websites. 

Check Connection Status: Check the current status of the elastic server and establish a connection. 

Reset connection: It removes the entire data and resets the connection of the elastic server. The admin can process the reindexing process either manually or set a cron job to automatically process it under the Index Management option. 

Search Settings

The next in the configuration list is Search Settings. 

In the first field i.e. Select Frontend Search type, under Search Settings, the admin must choose either Multi Match Query or Simple Match Query

Let us explore their configurations separately. 

Search Settings: Multi Match Query

On choosing the Select Frontend Search Type under Search settings Multi Match Query, the admin needs to configure fields such as Select Fields for Multi-Search, Select Multi-Match Type, Select Operator for Multi-Search, etc.  

wpdemo.webkul.com_woocommerce-elastic-search-103-80-65-178_wp-admin_admin.php_pagewkwces-settingsasd-2

The Multi-Match Query configurations may be set as under: 

Select:

  • Fields for Multi-Search: The admin chooses the fields such as name, SKU, description, etc. to execute multiple searches. 
  • Multi-Match Type: Against this field, the admin may choose Best fields, Most fields, Cross fields, Prefix and Prefix Phrase. To know more about Multi-Match types, tap here
  • Operator for Multi-Search: The admin may select either AND or OR operator to perform a multi-search. 

Minimum Should Match: The admin must specify the percentage or number of clauses in the returned data that should match.

Allow Spell Correction in Search: The admin has to choose either Level 1 or Level 2 against this field. 

  • At times the customers tend to type incorrect spellings when searching for products. 
  • Hence, as per the level (1 or 2) set by the admin, it corrects the misspelled word, automatically. 

Select Search filters: The admin adds filters such as Lowercase Filters, Synonym Filter,  Stop Word Filter, etc. (This field is discussed in detail below).

Use Stop Words Filter: The admin may set this field as ‘Yes’ or ‘No’ to enable or disable the stop words filter. 

Enter Comma Separated List of Stop Words: The admin adds a list of stop words that are separated by a comma. 

Select Language Stemmer: The admin selects an appropriate Language Stemmer as per the requirement of the store. 

  • For instance, if chosen as English, then customers can only process a search in the English language. 

Enter Comma Separated:-

  •  Words to exclude from Stemming: The admin can add comma-separated forms of words which should not be a part of the steaming process. For instance, the search results for products named as playing or cars will remain the same if a customer looks for it on the site. No Filter (play or car) shall apply as per the stemming procedure.
  • List of Filter Mappings: The admin adds character filters. If by chance, the customer adds a character or string of characters that is the same as that of the admin, it replaces and adds the value linked with it. 

Enter:- 

  • Pattern: The admin adds an expression against this field. If a customer tends to add some character in the search stream, it gets replaced with the admin string.
  • Pattern to replace with Filter Pattern: The character, which shall replace the customer added character stream if any. 
Search Settings: Simple Match Query

Under Simple Match Query, the admin will have to configure the fields such as Allow Spell Correction in Search, Select Search Filters, Use Stop Words Filter, etc.

wpdemo.webkul.com_woocommerce-elastic-search-103-80-65-178_wp-admin_admin.php_pagewkwces-settingsasd-3

The Simple Match Query settings may be set as under: 

Allow Spell Correction in Search: The admin may select Level 1 or Level 2 against this field. 

  • At times the customers tend to type incorrect spellings when searching for products. 
  • Hence, as per the level (1 or 2) set by the admin, the misspell word gets correct automatically. 

Select Search Filters: The admin may choose this as Lowercase Filters, Synonym Filter,  Stop Word Filter, etc.

Use Stop Words Filter: The admin may set this field as ‘Yes’ or ‘No’ to allow or disallow the stop words filter. 

Enter Comma Separated List of Stop Words: A  list of stop words that are separated by a comma. 

Select Language Stemmer: The admin selects an appropriate Language Stemmer as per the store’s requirement. 

  • For instance, if the Language Stemmer has been set to English, then customers can only process a search in English. 

Enter Comma Separated:-

  •  Words to exclude from Stemming: The admin adds word forms that must not include search string. 
  • List of Filter Mappings: The admin adds a character filter, which will replace the customer-added character string with the value associated with it. 

Enter:-

  • Pattern: The admin adds an expression, which replaces the customer’s added character stream if any. 
  • Pattern to replace with Filter Pattern: The character, which shall replace the customer added character stream if any. 

Set Cron for Index Management

At last, the admin has to set the configurations for- Set Cron for Index Management. 

wpdemo.webkul.com_woocommerce-elastic-search-103-80-65-178_wp-admin_admin.php_pagewkwces-settingsasd-4

The admin can set the configurations for Set Cron for Index Management as follows: 

Select Cron Status: The admin sets the status of the cron as Enable or Disable. 

Select Cron Frequency: The admin sets the cron frequency as Hourly, Daily, and Monthly.

Cron Start Time: The time when the cron must start. 

Further, to manually perform reindexing, the admin must navigate to Elastic Search > Index Management

It redirects to the Elastic Indexes page. The admin can tap on the Reindex button in the Action column to manually carry out the reindexing process for Products or Pages, as per the requirement. 

wpdemo.webkul.com_woocommerce-elastic-search-103-80-65-178_wp-admin_admin.php_pagewkwces-index-managementasd

Select Search Filters: Multi/ Simple Match Query

Select Search Filters is one of the most exigent configurations as the major part of the customer’s search depends on it. 

Against the Select Search Filters field, we can choose some filters. These include Lowercase Filter, Synonym Filter, Stop Words Filter, HTML Strip Char Filter, Mapping and Pattern Replace. 

webkul-woocommerce-elasticsearch-select-search-filters

Also known as Character Filters, these play a major role in eliminating the needless characters from the words which the customers type for searching for any entity.

Let’s define the Character Filters in detail:

  1. Lowercase Filter: This helps convert the lowercase alphabets in the customers’ search stream to upper case letters. 
  2. Synonym Filter: This adds a list of synonyms as per the store’s products. For instance, if the customers search for music (synonym for a singles product), the list of products under singles will display. 
  3. Stop Words Filter: If set as Yes, it removes the stop words from the customer’s search. 
  4. HTML strip char filter: The HTML strip character filter removes HTML elements with the ones which the admin adds. 
  5. Mapping Filter: The mapping filter is used to replace mapping keys with values. It will remove any character from the mapping.
  6. Pattern Replace Filter: This filter works in the same way as Mapping Filter but it will replace pattern instead of mapping. It uses a regular expression to replace characters.

To know more about the Character Filters, tap here

Synonym List: Elasticsearch 

To simplify the search process, the admin can even define a synonym list under Elastic Search > Synonyms List.

For instance, in the image below, the admin creates various synonyms for the product names ‘Singles’ and ‘Phone.’ 

If a customer wants to purchase a phone and types, suppose, mobile or cellphone, the results as per the product’s name ‘Phone’ shall display. 

wpdemo.webkul.com_woocommerce-elastic-search-103-80-65-178_wp-admin_admin.php_pagewkwces-synonyms-listasd

Moreover, the admin can create as many synonym lists as by tapping on Add Synonym tab. 

Frontend Workflow: Elasticsearch Process

Meanwhile, the customers can log in to make a purchase.

Search Results: On typing a wrong/ incomplete name of the product

For instance, a customer needs to buy a mobile phone. For this purpose, the customer tends to type ‘phon’ in the search boxes shown in the image below.

Though the spelling which the customer adds is not correct, it still displays the search results. 

Hence, this is the essence of the Elasticseach search scenarios. 

webkul-woocommerce-elasticsearch-search-results-customer-end-1

Search Results: On typing a synonym of a product’s name

This feature of Elasticsearch leverage the customers to search for any products by typing their synonym names on the search box. 

For instance, a customer who is looking for a music cd or DVD may tend to search the same by the name ‘music.’

The results will display by the store’s product name i.e. ‘singles’ present in the store as shown in the image below. 

webkul-woocommerce-elasticsearch-synonym-search

That’s all for the Elasticsearch for Woocommerce.

Support

For any technical assistance kindly raise a ticket or reach us by email at [email protected]

Thanks for Your Time!  Have a Good Day !!!

Current Product Version - 1.2.0

Supported Framework Version - WordPress - 6.2.2, WooCommerce - 7.8.0

Blog Version - WordPress - 6.2.2, WooCommerce - 7.8.0
  • Version WordPress - 6.2.2, WooCommerce - 7.8.0
  • Version WooCommerce 3.8.x, 3.7.x, 3.6.x, 3.5.x, 3.4.x, 3.3.x, 3.2.x, 3.1.x, 3.0.x
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


4 comments

  • Warren
    • Jyotsna Gautam (Moderator)
  • Omica
    • gunjita joshi (Moderator)
  • Back to Top

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home

    Table of Content