In which scenarios is Elasticsearch worth using?

Asked

Viewed 187 times

10

In which scenarios Elasticsearch is indicated as a replacement for ER or NOSQL database searches.

The main doubt is when I should use Elasticsearch, because I realize in my applications that a postgresql or mongodb already has satisfactory research in most cases.

If possible, please cite some use cases.

2 answers

1


Overall, for relatively simple searches Postgresql is good enough, which should probably be your case.

Elasticsearch becomes really relevant when you need more complicated search engines, such as complex matching with search terms or using different text parsers. If you have a very large volume of searches, Elasticsearch also behaves better than Postgresql (uses less hardware for the same result).

As an example, a Feature that I use at work and believe that it would be difficult to implement with Postgresql is the possibility of index synonyms for words. Another is the quick chance to find similar documents or suggest searches for your user.

These Features greatly enrich the search for an application and are simple to implement using Elasticsearch.

1

We can add some use cases of Elastic and Solr, which are similar products. Both tools are text search (text search), i.e., they are suitable when user searches are based on free text fields such as description or name.

Some examples that justify the adoption of a full text search tool:

  • Example 1: what records have the word "television" in their description.
  • Example 2: which records have a name similar to "milestone", such as milestones, rings and rings.
  • Example 3: which records have the words "database" and "data" separated by up to 2 words away.
  • Example 4 (advanced): which records are similar to "star Trek", such as "Battlestar Galactica".

A relational database even has these features, but it will never be as efficient as a specialized search engine (Elastic and Solr), because it is optimized for non-textual searches, which is exactly the opposite of a full text search tool.

Browser other questions tagged

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