How to improve your Magento Search?

in PerformanceTools Tags: Magentoperformance

Introduction

The built-in Magento search option is known for it’s non-existent speed and providing irrelevant search results. Both these aspects have a negative effect on your conversion, because if visitors can’t find what they’re looking for, how do you expect them to purchase from your shop? As a developer there are two things you can do;

  1. Tweak the built-in Magento search option
  2. Use an external search engine.

We recommend the latter, and specifically: Sphinx. Sphinx is an open source search engine that improves the search function in your Magento. Sphinx is fast and provides you with relevant search results. There are many external search engines, but Sphinx came out as the best option due to it’s usability, documentation and speed. Sphinx is supported on your Hypernode (Go Big and Excellence plans).

Another good search engine is ElasticSearch. If you have a Magento 2 shop, ElasticSearch has one advantage over Sphinx: you can use this search engine out-of-the-box, without having to install an extension. We have arranged special Hypernode discounts with our partner Bonsai, a specialised managed ElasticSearch provider. Ask our support team for the discount code!

Sphinx

Sphinx indexes up to 10-15 MB of text per second per single CPU core 60+ MB/sec per server. Technically, Sphinx is a standalone software package that provides fast and relevant full-text search functionality to client applications. It was specially designed to integrate well with SQL databases storing the data, and to be easily accessed by scripting languages. However, Sphinx does not depend on – or requires – any specific database to function.

We added support for the Sphinx search indexer on Hypernode Go Big and Excellent Nodes. Using Sphinx requires the Mirasvit Sphinx Search Ultimate extension. This paid extension can be purchased through the Mirasvit website. If you have a Magento 2 shop, make sure to use the specific Magento 2 extension.

More information about using Sphinx can be found in their documentation. Can’t find an answer to your question? Please contact Mirasvit through their Support Portal.

Configuring sphinx on hypernode

To configure the sphinx search on hypernode, all you need to do is install the magento extention from mirasvit and correct the settings in the sphinx configuration panel in the magento admin.

sphinx

Adjusting the settings of the mirasvit sphinx extension

When adjusting the sphinx settings, you should make use the following information:

Name Setting Value
Search Engine External Sphinx Search Engine
Sphinx Host localhost
Sphinx Port 9315
Sphinx Bin Path /usr/bin/searchd
Cron for Full Schedule 0 3 * * *
Cron for Delta Schedule */15 * * * *

Troubleshooting

  • When using the Mirasvit extention, magento periodically restarts the sphinx engine. If this happens too fast, the reload of sphinx can be ratelimitted causing the daemon to stop or to hang.
    To resolve this issue, whitelist the Zend_Http_Client as explained in the instructions how to prevent a useragent from being ratelimitted
  • If your shop is using too much memory, the searchd daemon can crash due to OOM. To resolve this upgrade to a bigger node, or improve the memory print of your webshop.

ElasticSearch

As an alternative for sphinx, magento supports Elasticsearch. Although we do not provide a locally installed elasticsearch daemon, mostly because elasticsearch is very resources intensive, you can easily use an externally hosted elasticsearch instance to improve your search functionality.

Overview

Pro’s:

  • Elasticsearch performs quick and advanced searches on products in the catalog
  • Elasticsearch analyzer support multiple languages
  • Supports stop words and synonyms
  • Indexing does not impact customers until reindex is completed
    Elasticsearch returns search results based on the last generated index until the new one has been completely indexed so there’s no disruption to customers
  • Accurate, performant, scalable
  • Works well out of the box
  • Easy to horizontally scale
  • Supports real-time data and analysis
  • Can be used as a document-oriented data store
  • Applications in framework beyond search—reporting, personalization, performance, and storage

Con’s:

  • Externally hosted

ElasticSearch providers

There a several companies you can choose for a monthly subscription:

If you choose Bonsai, we have made a special deal with bonsai. Please send a mail to support@byte.nl for a discount code

Install and Configuration

On all community editions you’ll need an extension to make ElasticSearch work on your Magento install. Magento 2 Enterprise has a module installed by default. 
There are many products available in the market, however, we recommend the Extension for Elasticsearch by Bubbleshop/Wyomind as the best extension we found.

We do have discount codes for this extension as well. Please send a mail to support@byte.nl if you want to receive a discount-code

After uploading extension files on your Magento root directory en flushing your Magento (and Redis cache) , you need to go to System > Configuration > Catalog > Catalog Search > Search Engine.
Choose ElasticSearch in the Dropdown and copy/paste the hostname in the red-outlined-field:

Don’t forget to Reindex the (new) indexes and if you want you can customize your search settings in System > Configuration > Bubble Extensions > Elasticsearch

Solr

A third option is SOLR. We don’t offer SOLR anymore due to low demand. If you want to use solr, we recommend using OpenSOLR as a hosted third party service.

0