Solr, Lucene and Elasticsearch what are the differences? When to use one or the other?

Asked

Viewed 2,064 times

4

What is the difference between Elasticsearch, Solr and Lucene?

When using one or the other?

1 answer

11


You should know that both serve to search various content.

Lucene

Lucene is at a lower level. So it gives more flexibility and fine-tuning than you want to do. On the other hand you have to know how to do everything you need, it’s more work. It’s usually interesting when you want to embed the search into your application and process it however you want.

Weld

Solr is an abstraction built on top of Lucene and is much easier to use, with almost everything ready. It is still possible to have a lot of flexibility, but for this it is more work and has some limitations, it is less work to make his standard. It meets most situations since it is more or less rare to need to do something different than what it offers.

There is a wider infrastructure offered by this tool. This includes HTTP services that allow you to use the search even without using the API in the programming language (Java for example) but consume the web-ready service.

Some resources available:

  • HTTP API exchanging data with XML/JSON
  • Filtering and targeted search (search helpers as suggestion)
  • Geospatial search
  • Incremental update
  • Cache
  • Data distribution and replication
  • Index replication
  • Administrative panel.

Note that newer versions of Lucene already have many of Solr’s features and are increasingly closing the gap between them. But there’s still the difference in how the service is offered.

Elastic Search

Elastic Search is a competitor of Solr. It is considered more modern by many and in fact has more facilities than the Solr, has a model that better meets many needs, mainly distribution (which is rare need) and close to real time upgrade. It cannot be said that he is more suitable than Solr always, because he has some limitations as well, his model can make certain needs difficult. And they say it’s even easier to work with him.

Has a website that makes a comparison between them (which are more directly comparable).

Functionality and scale

A common mistake is for people to think that everyone needs the most scalable solution possible. No, you’re not Facebook. Or even the Stack Exchange that is absurdly smaller. When I say that Sqlite is good for 90% of cases and an SQL server solves 99% that has full text search, Some people don’t believe.

These mechanisms are great and some ready-made things of them are very interesting, but rarely need anything beyond the trivial, especially when we talk about scale.

  • Hummmm... Solr uses Lucene. And can I use Lucene in a desktop application for example? Solr would serve a more robust web application?

  • And Elasticsearch, I saw that it uses Lucene as well. And it’s used by sites like Netflix, Foursquare and Stackexchange.

  • The idea is this. Of course you can use Solr in a desktop application but in a non-traditional way, not recommended in most cases. Solr can be considers the web application. It is usually used in a way that it is an independent service even if inserted in a website. Lucente can be used for this too, but you have to take care of everything. ES also uses it and today some people prefer to use it. I didn’t say anything because it’s not in the question. You can still edit if you think you should include it. I edit it later if that’s the case.

  • Thanks @bigown. Very enlightening answer. I think it will be useful for many programmers of the Portuguese language community.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.