Search Engines: Comparing Solr, Elasticsearch and OpenSearch

In today’s web applications, search functions are omnipresent. Searching for product titles or within a product description is a necessity for e-commerce, but the search isn’t limited to web applications. Different use cases lead to different requirements. Luckily, the open-source world provides a number of modern search engines to fit these requirements.

But which search engine is the right fit for your use case? This article outlines three possible options, two of which are available as a Managed Service at Nine: Apache Solr, Elasticsearch (which is not available as a Managed Service at Nine), and OpenSearch. 

Based on Apache Lucene

The three search engines have one thing in common. They are all based on the same powerful Java library: Apache Lucene. Apache Solr and Apache Lucene are both published by the Apache Foundation as open-source projects.

As they are based on Apache Lucene, all three search engines provide basic common search features, such as:

  • Ranked searching: search results with the highest relevance are shown first
  • Query types: phrase queries, wildcard queries, proximity queries, etc.
  • Sorting: search results can be sorted via fields
  • Features: highlighting, faceting (dynamic filtering), etc.

However, the search engines differ when it comes to complex features. 

Search Engine Popularity

Currently, Elasticsearch is the most popular search engine among the three options.

Source: https://db-engines.com/en/ranking_trend/search+engine 

Elasticsearch Licensing Change

First, let’s address the elephant in the room when it comes to Elasticsearch: its licensing change. Starting from version 7.10.2, the Elasticsearch licencing model was changed from the open-source licence ‘Apache 2.0’ to a ‘Server Side Public Licence (SSPL)’. Although the code is still available for download, the new licence is not compatible with the ideas of the Open Source Initiative (OSI). One major change is that Elasticsearch can no longer be provided to others as a Managed Service. Moving forward, this licence change effectively prevents us from providing newer versions of Elasticsearch as a Managed Service.

This licensing change prompted the creation of OpenSearch on 12 April 2021. It was forked from Elasticsearch 7.10.2 by Amazon. Some code was removed, meaning that it remained compatible with the Apache 2.0 licence. As we were unable to provide Elasticsearch as a Managed Service after the licensing change, we introduced OpenSearch as a replacement for Elasticsearch.

Choosing the Right Search Engine

All three search engines offer a wide variety of features and are suited to most use cases. If you are experienced with one of the search engines, we recommend you to go with that one. It is generally accepted that the differences between these search engines are so small that prior experience is a valid reason for choosing one over another.

Please bear in mind that, due to the aforementioned licence restrictions, Nine is offering OpenSearch and Solr, and cannot provide Elasticsearch as a Managed Service.

We nevertheless include Elasticsearch in our list of key differences between the three search engines in the next chapters.

Differences Between Apache Solr and Elasticsearch

Differences in Features

When it comes to the features, the key differences are as follows:

  1. Main Focus: Solr’s primary strength lies in its robust full-text search capabilities, offering a wider range of features in this area compared to Elasticsearch. While Elasticsearch simplifies its interface through a straightforward API, it sacrifices some flexibility in the process. Meanwhile, Elasticsearch excels at handling time series data and analytics, and is renowned for its exceptional scalability, processing time series data, and analytics.
  2. Data Handling: Both provide a variety of options and data sources, such as JSON or CSV. However, Solr works with predefined schemas, whereas Elasticsearch is more flexible, due to its schema-free approach. Although Solr’s schemas can also be defined to be more dynamic, it cannot match Elasticsearch in that regard.
  3. Query Language: Solr’s query language is more sophisticated and allows for more complex searches. In contrast, Elasticsearch provides a simpler and more intuitive syntax.
  4. Scalability: Although both systems are highly scalable, Elasticsearch has a distributed architecture and supports automatic sharding. 

Differences in Community

Apache Solr has a longer development history, and this comes with a more mature open-source community. However, Elasticsearch benefits from a vibrant and active Elastic community. As of May 2024, according to DB-Engines, Elasticsearch is generally more popular than Apache Solr.

Differences between Elasticsearch and OpenSearch

Differences in Features

Although OpenSearch was forked from Elasticsearch in Version 7.10.2, some differences have emerged in the meantime.

Their common functionality is coming from Apache Lucene, which both are based on. Some specific functionality, such as authentication or authorisation, index management and alerting, are proprietary in Elasticsearch, and thus had to be implemented with open-source alternatives in OpenSearch.

Since the two search engines are developed independently, some new features are mutually exclusive. For example, Elasticsearch has added ‘Time Series Data Streams’ (TSDS), which allow for time stamped metrics data as one or more time series. Meanwhile, OpenSearch reintroduced segment replication, which enables copying segment files across shards, instead of documents being indexed on each shard copy.

Differences in Community

Currently, there seem to be more contributions to Elasticsearch than to OpenSearch. However, interest in OpenSearch keeps rising, while the interest in Elasticsearch is slowly declining. Due to Elasticsearch’s licensing change, there are many providers who no longer offer Elasticsearch as a Managed Service.

Talk to one of our experts

Do you have any questions about our products? Either contact Sales or go directly to your cockpit to see all the possibilities at Nine.