The paper

Elasticsearch is a Lucene-based search server. It provides a distributed multi-user capable full-text search engine, based on a RESTful Web interface. Developed in the Java language and released as open source under the Apache license, Elasticsearch is a popular enterprise-class search engine. ElasticSearch is used in cloud computing. It is stable, reliable, fast and easy to install and use. Official clients are available in Java,.NET (C#), PHP, Python, Apache Groovy, Ruby, and many other languages. According to DB-Engines’ rankings, Elasticsearch is the most popular enterprise search engine, followed by Apache Solr, also based on Lucene.

The origin of the Es

Many years ago, a newly married unemployed developer named Shay Banon followed his wife to London, where she was studying to cook. While looking for a lucrative job, he started using an early version of Lucene in order to create a recipe search engine for his wife.

It was difficult to use Lucene directly, so Shay started building an abstraction layer that Java developers could use to easily add search functionality to their applications. He released his first open source project, Compass. Then Shay got a job working on high-performance, distributed in-memory data grids. The need for a high performance, real-time, distributed search engine was particularly acute, so he decided to rewrite Compass and turn it into a separate service called ElasticSearch.

The first public version was released in February 2010, and since then Elasticsearch has become one of the most active projects on GitHub. It has over 300 combors (currently 736). One company has started providing commercial services around ElasticSearch and developing new features, but ElasticSearch will always be open source and available to everyone.

Rumor has it that Shay’s wife is still waiting for her recipe search engine…

Difference between Elasticsearch and Lucene

  • Lucene is an open source full text search engine toolkit, but it is not a complete full text search engine, but a full text search engine architecture, provides a complete query engine and index engine, part of the text analysis engine, It can be conveniently embedded into various applications to achieve full-text indexing/retrieval functions.
  • Elasticsearch is a Lucene-based search server. It provides a distributed multi-user capable full-text search engine, based on a RESTful Web interface. Developed in Java and released as open source under the Apache license, Elasticsearch is a popular enterprise-class search engine. Designed for cloud computing, can achieve real-time search, stable, reliable, fast, easy to install and use.

Solr profile

Solr is a top open source project under Apache. It is developed in Java. It is a full-text search server based on Lucene. Solr provides a richer query language than Lucene, while achieving configurable, extensible, and optimized indexing and search performance

Solr can be run on its own, in Servlet containers such as Jetty, Tomcat, and so on. The Solr index is implemented by simply sending an XML document describing the Field and its contents to the Solr server using POST. Solr adds, deletes, and updates indexes based on XML documents. Solr searches simply send HTTP GET requests, and then parse the results of the queries that Solr returns in XML, JSON, and other formats to organize the page layout. Rather than providing the ability to build a UI, Solr provides an administrative interface through which you can query Solr’s configuration and health.

Solr is an enterprise-class search server based on Lucene, which essentially encapsulates Lucene.

Solr is a standalone enterprise search application server that provides a Web-Service-like API to the outside world. The user can submit a file of a certain format to the search engine server through HTTP request and generate the index; You can also make a search request and get the result back.

Difference between Elasticsearch and Solr







Difference between Elasticsearch and Solr

Both are easy to install; Solr uses ZooKeeper for distributed management, while Elasticsearch itself has distributed coordination management function. Solr supports more data formats, while Elasticsearch only supports JSON file formats; While Solr officially offers more features, Elasticsearch itself is more focused on core features, with more advanced features provided by 3rd party plugins. Solr performs better than ElasticSearch in traditional search applications, but is significantly less efficient than ElasticSearch when handling real-time search applications. Solr is a powerful solution for traditional search applications, but ElasticSearch is better suited for emerging real-time search applications.

The installation

Download the ElasticSearch

Lead the environment
  • JDK8 or above
  • Linux environment (or Windows)

Website:https://www.elastic.co/cn/elasticsearch/

Select the past version

Select version, select version 7.6.1, and download

Then select the Linux version to download
Upload to /opt directory to execute the command, unzip

Tar – ZXVF elasticsearch 7.6.1 – Linux – x86_64. Tar. Gz

Modifying configuration files
  • Node.name The name of the node
  • The network.host extranet accesses the native IP
  • Cluster.initial_master_nodes cluster node

Enables cross-domain access
# Add the following command to the end of the configuration file, then save and exit. http.cors.enabled: true http.cors.allow-origin: "*"

Create users and user groups

Elasticsearch adds users and user groups and authorizes them

groupadd es
useradd es -g es -p es
chown -R es:es elasticsearch

You then type su es to switch the user to boot. If you don’t switch the user, an error message will appear.

Go to the es/bin directory and start es
./elasticsearch &

When you see “Started”, it means that the startup was successful

  • Browser access: own server IP :9200, if not modified.
  • If you have access problems, check that the Linux firewall is off?
  • Is the configuration file configured correctly?

If there is no problem, You can see the following classic statement: “You Know, for Search”/” You Know, for Search”.

Download the ElasticSearch – head

ES-Head is a visualization tool for ES provided by Elastic

Install the elasticSearch – head

Check if the server has the NodeJS tool
node -v

If there is a version number, it means that this tool is available. If not, you can download it from the official website. Nodejs: http://nodejs.cn/download/

Download the ElasticSearch – head

github:https://github.com/mobz/elast…

Once the download is complete, use the command to unzip it.
mkdir ./elasticsearch-head & unzip elasticsearch-head-master.zip -d ./elasticsearch-head

Go to the elasticsearch-head directory and execute the command

npm install
npm run start

You can see that it has started, access the service, here the service IP is native IP + port 9100

Install kibana

Kibana is introduced

Kibana is a free and open user interface that allows you to visualize Elasticsearch data and allow you to navigate the Elastic Stack. You can do everything from tracking query load to understanding how requests flow through your entire application with ease.