This is the second day of my participation in the August More Text Challenge
Said the first train of thought in the coming days, it is the way it is, received a demand, statistical year somewhere users running water data in detail, and then when the user want to undertake certain actions match the data query, to sign and then the code logic judgment, demand is very simple, but the client urged ES implementation, (although ES would slow down the project)
Since I want to use ES, but I am small white ah, how to do, then learn from scratch together!!
What is ES
Elasticsearch is a distributed, RESTful search and analytics engine that addresses a variety of emerging use cases. At the heart of the Elastic Stack, it stores your data centrally, helping you find what you expect and what you don’t expect.
Elasticsearch is the most popular enterprise search engine. Near real time search and data analysis engine. It makes it easy to search, analyze and explore large amounts of data. Make full use of Elasticsearch’s horizontal scalability, a true representation of value data.
Why ES
Here’s another official quote:
The ability to perform and merge multiple types of searches (structured data, unstructured data, geographic location, metrics) in a variety of ways;
Capable of analyzing large amounts of data;
Fast retrieval with inverted index, column mode (near real time)
Applicable to all types,
Distributed, hot backup; Stability is very reliable;
I’m not going to talk about installation, there are a lot of tutorials online,
Elasticsearch has been successfully installed on your computer by entering the url “http://localhost:9200/” in your browser:
{
"name" : "master",
"cluster_name" : "es_cluster",
"cluster_uuid" : "NzeIhykVQDaPCOkD-vPtJA",
"version" : {
"number" : "7.8.1",
"build_flavor" : "default",
"build_type" : "rpm",
"build_hash" : "b5ca9c58fb664ca8bf9e4057fc229b3396bf3a89",
"build_date" : "2020-07-21T16:40:44.668009Z",
"build_snapshot" : false,
"lucene_version" : "8.5.1",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
Copy the code
If you want to interact, you can do it with Kibana. The interface is pretty clean,
What can ES do
When we need to operate on a large amount of data, traditional data storage has been difficult to parse data, which requires a search engine, and the inverted index of ES is a good solution to this problem;
The third party tool Kibana interface is very beautiful, you can carry out various related operations on the interface, simplify the time;
When we need to do a global fuzzy search of the data, or we only know part of the keyword, such as you baidu “Java program” the two words, it will contain the results of all contain Java and programs and Java programs
If you go to Baidu search, maybe you can better feel the benefits brought by the word segmentation, you may ask what the rules of word segmentation are, I can only say THAT I don’t know, but it must be according to the scene analysis, which is also the reason for the company to analyze the data regardless of the cost;
After the data is analyzed and classified, there will be a priority ranking, different product positioning is different, such as Baidu “clothes” keyword and small red book “clothes” keyword search priority must be different, because the product positioning is different;
Ok, so much about ES, in fact, ES is not only for search, you can go to the official website, of course, part of the charge, ha
Ok, so much for getting started, let’s start to understand how it works