Learn more about Elasticsearch

Tram Ho

What is Elasticsearch?

Elasticsearch, or ES for short, is a search engine software released under the Apache License license. This Search engine is distributed organization, built on RESTful API mechanism like a cloud server. Developed by java. Based on the legacy and development from Lucene Apache. With small and medium data you can search on files, on data platforms such as Oracle, MySQL, MongoDB … but for large data cases, you should choose the more optimal way by transferring data. Then going to Elasticsearch and doing a search on Elasticsearch will bring great efficiency.

Advantages

Powerful search capabilities based on Apache Lucene and data analysis. Scalable horizontally. Whether you are searching for misspelled keywords or not in the right syntax, it is supported to return very good results. Support specific and explicit specification of specific queries with JSON, Structured Query DSL (Domain-Specific Language), Elasticsearch client such as Java, Php, JS, Ruby, etc.

Defect

Although Elasticsearch was created for searching purpose, but for tasks other than Search Curd, elastic is weaker than other databases such as Mongodb, Mysql…. Therefore, people rarely use elasticsearch as the main database like MongoDB or Mysql. In elasticsearch, there is no concept of database transaction, so Elasticsearch does not guarantee the data of activities such as Insert, Update or Delete, when we make changes to many records, if an error occurs, our logic will occur. Wrong or lead to data loss. This is also one part that makes elasticsearch should not be the main database. For systems that regularly update data, using Elasticsearch will be very expensive for indexing data.

Mechanism works with Elasticsearch

All aggregated data, user uploaded data will be saved to the database, then they are synchronized to Elasticsearch. Since then, when users search, they will search on Elasticsearch, fast speed, just reduce the load for the database.

Install ElasticSearch

Request

Before installing Elasticsearch, you should make sure that your machine is from Java 8 and above and must set the environment variable JAVA_HOME for java, otherwise it will not be installed. By checking with the java -version command, you will know if your computer has Java installed and what version of Java you are installing. Check that the JAVA_HOME environment variable has been set using the command: echo $ JAVA_HOME

Setting

How to install Elasticsearch is not difficult, but quite complicated and many steps, here are some brief guidelines but you should also learn more in other sources to avoid the hassle of installing and booting. . To install Elasticsearch on Ubuntu we have 2 ways to install from the Repository or install from the .deb file

Method 1: How to Elasticsearch by APT Repository

Install using apt-transport-https

Method 2: install elasticsearch with the .deb package

Run the following commands to download and install elasticsearch using the .deb file

References

In order to get more complete installation instructions, there are still a number of activities, APIs to handle in manipulating Index in Elasticsearch, but with the above learning about a powerful tool like elasticsearch is enough. to be able to manipulate, use and become familiar with elasticsearch. You can refer to the document page below.

Elasticsearch – Search APIs – Tutorialspoint

Elasticsearch in 5 minutes – Elasticsearch Tutorial.com

Elastic Stack and Product Documentation | Elastic

What is Elasticsearch? | Elasticsearch basics

Share the news now

Source : Viblo