OpenSearch – What are the advantages in e-commerce?

11.05.2023
extendedLogo

Anyone searching for specific products or categories in an online shop wants to receive suitable search results within seconds. In this blog post we show how the full-text search engine OpenSearch can support this.

The integrated search function is a central element of successful online shops. For smaller shops with a manageable number of products, the search can be mapped via a database management system such as MySQL. The larger and more extensive the shop and the product range it contains, the more important the search is in terms of a good user experience. Search engines such as OpenSearch were developed for these use cases.

A powerful full-text search engine provides users with orientation by delivering results quickly and accurately. In addition to speed and quality, features such as full-text retrieval, auto-completion or scroll search also play a role.

What is OpenSearch?

OpenSearch is a comprehensive search and analysis suite available under the Apache 2.0 open source licence. It is based on the Apache Lucene program library and enables a wide range of applications including real-time monitoring, log analysis, website search and more.

OpenSearch was initiated as an open source project by Amazon Web Services (AWS) in 2021. The tool emerged as a fork from search engine Elasticsearch after provider Elastic NV announced a licence change. Since then, Elasticsearch is no longer offered under an open source licence, but exclusively under a commercial licence. In addition, OpenSearch Dashboards, a fork of the analytics platform Kibana, which is also affected by the licence change of the provider Elastic NV, is included in OpenSearch.

OpenSearch 1.0 was released for product use in July 2021. While OpenSearch was initially a 1:1 copy of Elasticsearch 7.10, further development over the past two years has taken a course that has been significantly influenced and steered by the growing community. The short development cycles of new minor versions on the Roadmap of OpenSearch make it clear that the community still has a lot planned and is constantly developing the tool.

Advantages of OpenSearch

There are many advantages to using OpenSearch as a search and analysis suite. We have listed some of them below:

  • Open Code: Since OpenSearch completely follows the open source principle, the code can not only be used and adapted individually, but also used commercially. Download, installation and operation are free of charge.
  • Programming languages: OpenSearch supports the use of several programming languages, including Python, Java, JavaScript, Go, Ruby, PHP, .NET and Rust. In addition, most language clients compatible with Elasticsearch 7.10.2 are also supported by OpenSearch. OpenSearch provides more information about this on an overview page for language clients.
  • Distributed Architecture: Due to its distributed infrastructure, OpenSearch is able to aggregate and store even large amounts of data in real time. Thanks to its flexible scalability, it can react quickly to peak loads.
  • Visualisation and reporting: Using OpenSearch dashboards, data can be monitored and analysed in real time. The data can be visualised graphically and exported to reports.
  • Persistent data storage: Data is stored in JSON format and can be reused by any tool with a JSON-enabled API.

Main view of OpenSearch Dashboards | Quelle: OpenSearchMain View of OpenSearch Dashboards | Source: OpenSearch

Disadvantages of OpenSearch

Since OpenSearch evolved from Elasticsearch, there are few differences so far in terms of usage and resource consumption. The REST APIs for ingest, search and management are backwards compatible with OpenSearch. Under OpenSearch 1.3, for example, it is possible to use indexes from Elasticsearch versions 6.0 to 7.10.

It must be noted, however, that OpenSearch and Elasticsearch are being developed independently of each other and will have further differences in the future. The later a migration from Elasticsearch to OpenSearch is carried out, the more difficult it will be to manage.

You should also check whether your CMS or shop system officially supports OpenSearch. Some tools or clients may contain code that restricts or completely hinders the functionality of OpenSearch. You should also ensure that the interface of your hosting or cloud provider has OpenSearch integration.

How does OpenSearch work?

OpenSearch aggregates raw data such as logs, system metrics and traces via data ingestion. This data can be read using SQL query syntax in the form of JSON documents or CSV tables.

The aggregated data is indexed to be used for search queries. This means that incoming search queries do not have to search through all documents. Instead, indexes whose mode of operation is similar to a database are searched. Each index stores documents, which in turn can be assigned to different types. In this way, the search engine can search document data almost in real time.

OpenSearch can use manual and dynamic mapping to define how data is stored in indexes. With the Index State Management function, indices can be managed and optimised over their entire lifetime. This is done by defining different policies, each containing a list of states that are applied to the respective index. With the help of index rollups, new indexes can also be created from previously defined areas.

Just like Elasticsearch, OpenSearch is also flexibly scalable. Shard distribution can be used so that large amounts of data that exceed the capacity of a single server do not become a bottleneck. This is a method for database partitioning. Large databases are divided among different indices. These in turn are distributed across different cluster nodes to ensure fast response times to search queries.

Migration from Elasticsearch to OpenSearch

Those who want to migrate Elasticsearch instances to OpenSearch can resort to three different approaches, depending on the Elasticsearch version used as well as the type of installation.

  1. Elasticsearch data can be migrated to an OpenSearch cluster with a snapshot. However, this may result in downtime.
  2. a restart upgrade updates and restarts the entire cluster. A rolling upgrade, on the other hand, allows individual cluster nodes to be upgraded and restarted one at a time. Elasticsearch nodes can also be replaced by new OpenSearch nodes. This method is used in particular for clusters with Docker support.
Creating Snapshots

A snapshot of all Elasticsearch indexes should be created in advance in any case. If there is a loss of data or technical difficulties during the migration, the backup can be used to restore the original state.

All three methods mentioned are contained in detail in the OpenSearch documentation.

Which shop systems are compatible with OpenSearch?

Before planning a move from Elasticsearch to OpenSearch, you should first check whether your shop system supports the use of OpenSearch. In the following table you will find an overview of the supported versions of popular shop systems.

Shop systemCompatibilityNotes
Magento 2Compatible with Magento 2.4.4 and higher
Shopware 6OpenSearch 1.0 or higher required
Shopware 5(✓)Not officially supported

OpenSearch and Magento 2

Magento Open Source and Adobe Commerce are compatible with OpenSearch 1.0 and newer versions since the release of version 2.4.4. Retroactive support for Magento versions 2.4.3 and 2.3.7 has also been implemented.

As of Magento 2.4.6, OpenSearch is supported by default as a full-text search engine. Adobe recommends the use of OpenSearch 2.0 or newer versions. Further information on this can be found in the Adobe documentation.

OpenSearch and Shopware 6

Shopware 6 is officially compatible with OpenSearch. OpenSearch 1.0 or a newer OpenSearch version is required to run Shopware 6. In turn, Shopware 6.4.0.0 or a newer Shopware version is required to run OpenSearch. Further information can be found in the System Requirements of Shopware 6.

OpenSearch and Shopware 5

Shopware 5 does not officially include support for OpenSearch. There are several reasons for this. For one, Shopware 5 itself is only officially supported until August 2024 and the last feature update will even be released this year. For another, Shopware 5 is compatible with Elasticsearch versions in all versions released so far that are still under open source licence. So traders who have an online shop based on Shopware 5 are not necessarily dependent on a commercial Elasticsearch version.

These reasons make it unnecessary for the provider to integrate official support from OpenSearch. However, since OpenSearch is fundamentally backwards compatible with Elasticsearch 7.10 and older versions, it should still be possible to use OpenSearch under Shopware 5.

Alternatives to OpenSearch

Besides OpenSearch, there are also some alternatives that e-commerce traders can fall back on to integrate an efficient full-text search into their online shop.

Elasticsearch

Elasticsearch is the search and analysis suite from which OpenSearch emerged as a fork. The solution, which was initiated as an open source project in 2010, has long been state of the art for web applications with complex requirements and large data sets.

Elasticsearch impresses above all with its wide range of functions. Both structured and unstructured data can be processed with Elasticsearch. It does not matter whether it is text data, numerical data, geodata or other data types. Due to its distributed nature, large amounts of data can be distributed via sharding to cushion peak loads.

Due to the licence change that came into effect in January 2021, newer versions of Elasticsearch are only available proprietary against licence fees. With many hosting and cloud providers (including maxcluster), Elasticsearch is therefore only available up to version 7.10.2.

Solr

Apache Solr is a full-text search tool available under an open source licence. Just like OpenSearch and Elasticsearch, the solution is based on the Apache Lucene program library. Solr is particularly convincing due to its easy scalability and high error tolerance. Data can be indexed in real time without interruption. The functional environment of the software is very clear, offers many features and can be extended with numerous plug-ins.

Sphinx

The full-text search engine Sphinx is an open-source application that can be used to efficiently search large amounts of data. Sphinx can batch index and search data from various sources such as SQL databases or NoSQL stores.

MySQL

As mentioned at the beginning, MySQL can be a suitable alternative for the shop's search function for smaller online shops. MySQL database servers are based on SQL (Structured Query Language) and are multithreaded and fast. However, for larger product catalogues with many variants, product searches can be carried out more efficiently and faster with the previously presented search engines.

OpenSearch at maxcluster

Since 2022, OpenSearch has been a fixed component of our e-commerce stack at maxcluster and is available as a search engine on all clusters alongside Elasticsearch (up to and including version 7.10.2), Sphinx and Solr.

OpenSearch can be installed and set up via the Application Centre with just a few clicks. We have summarised further information on OpenSearch hosting at maxcluster in our OpenSearch-FAQ. If you have any questions or problems setting up and using OpenSearch, please feel free to contact our service team by phone at +49 5251 4141 30 or by e-mail at support@maxcluster.de.

Conclusion

Originally initiated as a reaction to the licence change of Elasticsearch, OpenSearch has become a firmly established player among full-text search engines in a short time. With AWS and the open source community, the software has strong drivers in the background. As a fork of Elasticsearch 7.10, OpenSearch also has a stable basic framework on which the community is driving further development.

Anyone who wants to use a powerful search and analysis suite and attaches importance to open source is well advised to use OpenSearch in many cases. Before using it, however, you should check whether your own web application supports OpenSearch. In addition, it should be ensured that the chosen hosting or cloud provider has integrated the application into its tech stack.


Published on 11.05.2023 | DR

You have questions, requests, criticism, suggestions or just want to tell us your opinion about our blog? Here you have the opportunity to contact us directly.

Send e-mail