Search Engines: Comparing Solr, Elasticsearch and OpenSearch

Kevin Ferranti May 29, 2024
Search Engines: Comparing Solr, Elasticsearch and OpenSearch

Search functions in today's web applications are omnipresent. Searching for product titles or within a product description for an online shop is a necessity, but search isn’t limited to web applications. With different use cases, different requirements come up. Luckily, the open-source world provides a few modern search engines to fit these requirements.

But which search engine is the right fit for your use case? This article seeks to inform you about three possible options, two of which are available as a Managed Service at Nine: Apache Solr, Elasticsearch (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 programmed alongside each other as open-source projects.

Thanks to their basis on Apache Lucene, all three search engines provide basic common search features, including:

  • Ranked searching: the search results with the highest relevance are shown first
  • Query types: phrases 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 Engines Popularity

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

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

Licensing change of Elasticsearch

First, let’s address the elephant in the room when it comes to Elasticsearch: its license change. Starting from version 7.10.2, the license of Elasticsearch was changed from the open-source license "Apache 2.0" to the "Server Side Public License (SSPL)" license. Although the code is still available for download, the new license isn't compatible with the ideas of the Open Source Initiative (OSI). A major change is that Elasticsearch can't be provided to others as a Managed Service anymore. Moving forward, this license change effectively prevents us from providing newer versions of Elasticsearch as a Managed Service.

This license change has prompted the creation of OpenSearch on April 12, 2021. It was forked from Elasticsearch 7.10.2 by Amazon. Some code needed to be removed, so it stayed compatible with the Apache 2.0 license. As we were unable to provide Elasticsearch as a Managed Service after the license change, we introduced OpenSearch as a replacement for Elasticsearch.

Choosing the right Search Engine

All three search engines have a wide variety of features and are suited for most use cases. If you have experience 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 this is a valid reason to choose one over the other.

Please mind that because of the aforementioned license restrictions, Nine is offering OpenSearch and Solr and can’t provide Elasticsearch as a Managed Service.

However, we still provide a 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 in handling time series data and analytics, and is renowned for its exceptional scalability, processing time series data, analytics, and is known for its great scaling capabilities.
  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 can’t match Elasticsearch in that regard.
  3. Query Language: The query language of Solr is more sophisticated and allows for more complex searches. On the other hand, 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 got a longer development history and with it comes 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, there are differences that emerged in the meantime.

The common functionality is what's coming from Apache Lucene, which both are based on. Some specific functionality, such as the authentication or authorization, the index management and the alerting was proprietary in Elasticsearch and had to be implemented with open-source alternatives.

Since the two search engines are developed independently, there are new features that are mutually exclusive to one of the search engines. For example, Elasticsearch has added “Time Series Data Streams” (TSDS), which allows for time stamped metrics data as one or more time series. OpenSearch reintroduced segment replication, which allows 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. Because of the license change of Elasticsearch, there are many providers that do not offer Elasticsearch as a Managed Service anymore.