[Elasticsearch Beginners - notes with vernacular] tell you what Elasticsearch

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/mr_zhuqiang/article/details/88642111

Tell you in plain English what is Elasticsearch

Elasticsearch, distributed, high-performance, highly available, scalable search and analysis system

  1. What is search?
  2. What happens if you do a search with a database?
  3. What is the full-text search, inverted index and Lucene?
  4. What is Elasticsearch?

What is search?

Baidu: For example, we want to find any information and they will go to the Baidu search, for example, find a movie you like, or find a favorite book, or find a news of interest (referred to Search first impression)
Baidu! = search, it is not right

Vertical search (Search Site)

Internet search: Electric's Web site, job sites, news sites, various app
search IT systems: OA software, office automation software, conference management, schedule management, project management, staff management, search for "John Doe", "Joe Smith child "," Zhang three "; there is electricity's website, the seller, back office systems, search for" toothpaste "orders," toothpaste-related orders. "

Search is under any scenario, to find the information you want, at this time, you can enter a keyword to search for a while, and then expect to find some information related to this keyword

What happens if you do a search with a database?

Do software development, then, or for IT, computers have a certain understanding, then, to know that the data is stored in a database, for example product information electricity supplier site, jobs recruitment site, news site news and information, etc. wait. So, it is natural that, if to consider from a technical point of view, such as how to say, the internal electricity supplier site search, then you can consider, to use the database to search.

Electricity supplier product search system: If the figure below

  1. Search products containing toothpaste
  2. Trade names in the database field stores the keyword

Database to deal with the case, regardless of what database of full-text index, if there are 10 million of goods, so basically we must find 10 million times, and every time you need to load the whole string trade name of the field, and one by one to find .

  1. For example, the text specified field of each record, may be very long, such as "Product Description" length of the field, as long as there are thousands, even tens of thousands of characters, this time, every time for each All text records are scanned, lazy judge said, you package does not contain the key words I specify (such as "toothpaste")

  2. Search term can not split open, as far as possible to the search results more in line with your expectations, for example, enter "biochemical machines", they search out "Resident Evil"

Search the database to achieve, it is unlikely to fly. In general, the performance will be poor.

What is the full-text search and Lucene?

  1. Full-text search, inverted index

  2. lucene, is a jar package,

    Which contains a variety of packaged create an inverted index, and search code, including various algorithms.

    When we use java development, the introduction of lucene jar, then based api lucene were to develop it. With lucene, we can go to the existing data indexing, lucene local disk above will give us the organizational structure of the index data. In addition, we can use some of the features and api provided lucene to search for data on the disk

Full text search and retrieval inverted index briefly

Simply put it in the following figure


Scene: search for "biochemical machines" (there may be trembling of the hands wrong, originally Resident Evil), but expectations need to come out four records on the right side

  1. There are four data
  2. Each data entry will be split. Such as "Resident Evil movie" split into: Biochemical crisis, movies keyword (split results and strategy algorithm related)
  3. Each keyword corresponding to the keyword data ID contained in this
  4. When searching, direct matching these keywords, you can get data containing keywords

This process is called full-text search. The split entry and the corresponding entry ID This is the basic principle of the inverted index

What is Elasticsearch?

We can use lucene search services to develop, deploy a machine above, but can not solve the problem when the amount of data increases the time (Figure on the right side). So elasticsearch tool is to solve such a scenario;

  1. Index distributed to multiple nodes automatically establishing maintaining data, distributed search request to the plurality of nodes performing

  2. Automatically maintain redundant copies of data to ensure that some of the machine is down, without losing any data

  3. It encapsulates the more advanced features

    Give us more advanced support, let us quickly develop applications, the development of more complex applications;
    sophisticated search functions, aggregation function analysis, multi-location based search of (my current position within the distance of one kilometer rotisserie)

GIHUB:https://github.com/zq99299/note-book/blob/master/docs/elasticsearch-core/02-whatis/index.md

Guess you like

Origin blog.csdn.net/mr_zhuqiang/article/details/88642111