Elasticsearch Basics (1): Introduction to Elasticsearch

foreword

This article will introduce what Elasticsearch is, understand how Elasticsearch is the core of a distributed search and analysis engine, and how it handles indexing, searching, and analyzing data. At the same time, it also shares some methods and resources for learning Elasticsearch, which can quickly learn and get started to complete work needs. At the same time, in order to improve my reading ability for learning English documents, this article will quote a lot of the original English text of official documents.

This article is based on the official documentation: Elasticsearch Guide [7.9]

1. Introduction to Elasticsearch

Elasticsearch is one 开源的分布式搜索和分析引擎, and it's built on Apache Lucenetop of search libraries. It is designed to handle large datasets and improve 供实时搜索和分析functionality. Elasticsearch is 高可用性、可扩展性和容错unique and can quickly process structured and unstructured data.

It supports 全文搜索、实时数据分析和复杂的查询and can be used to build a variety of applications, including log analysis, real-time metrics and metrics visualization, full-text search, security analytics, and more. Elasticsearch provides a Restful API that developers can easily interact with and supports clients in various programming languages.

Elasticsearch 分布式operates in a way that data can be sharded and distributed to multiple nodes to achieve 水平扩展和负载均衡. It also provides powerful 查询和聚合functions that allow users to perform complex analysis and mining of data

2. Features and uses of Elasticsearch

Elasticsearch has the following characteristics and uses. According to official documents and actual usage, its application in many companies and institutions can be illustrated.

2.1 Main features of es

  1. 分布式和可扩展性: Elasticsearch uses a distributed architecture, which can easily scale horizontally, handle large-scale data sets and provide high-performance search and analysis functions.
  2. 实时性能: Elasticsearch provides 近实时(near real-time)和分析能力fast response to query requests, supports fast iteration and interactive exploration of data.
  3. 多种数据类型支持: Elasticsearch supports a variety of data types, including structured, semi-structured and unstructured data, which can meet the data storage requirements of various application scenarios.
  4. 强大的查询和聚合功能: Elasticsearch provides a rich query language and aggregation functions, enabling users to perform complex queries and data analysis operations, including 全文搜索、过滤、排序、分组etc.
  5. 文档导向: Elasticsearch stores and retrieves data in units of documents, and each document has a unique ID, which facilitates data management and organization.

2.2 Purpose of es search and data analysis

  1. 搜索引擎: One of the most common uses of Elasticsearch is to build real-time search engines. Many companies and websites use Elasticsearch to provide fast and accurate search capabilities, such as product searches for online stores, article searches for news sites, and more.
  2. 日志分析: Due to its high performance and real-time performance, Elasticsearch is widely used to process large amounts of log data. Many companies use Elasticsearch to centrally store and analyze log data for troubleshooting, security analysis, and performance monitoring.
  3. 数据分析和可视化: The combination of Elasticsearch and tools such as Kibana can be used for real-time data analysis and visualization. For example, a company can use Elasticsearch to store and analyze sales data and use Kibana to create dashboards and graphs to monitor sales trends and business metrics.
  4. 实时监控和警报: Many companies use Elasticsearch to monitor system metrics, network traffic, application logs, etc. in real time. When specific conditions are met, alert mechanisms can be set up to notify administrators in time or take automated actions.
  5. 电子商务和推荐系统: Elasticsearch can be used to build product search and recommendation systems for e-commerce platforms. By leveraging its full-text search and relevance algorithms, it can provide accurate search results and a personalized recommendation experience.

2.3 Practical application in production environment

Many well-known companies and institutions use Elasticsearch in production environments, the following are some examples of them:

  1. Netflix: Using Elasticsearch for real-time monitoring and
    analytics to support operations and troubleshooting of its video streaming platform.
  2. GitHub: Integrate Elasticsearch with Kibana for storing and analyzing large amounts of log data to monitor system performance and application behavior.
  3. Uber: Use Elasticsearch and Kibana to build a real-time monitoring system for tracking the location of passengers and drivers, traffic conditions, etc.
  4. Stack Overflow: Use Elasticsearch to provide powerful full-text search capabilities, enabling users to quickly find relevant technical questions and answers.
  5. Meituan: In the search engine of Meituan Dianping, Elasticsearch is used to support real-time search and recommendation functions of merchants and products.

These are just a few of the companies and institutions that use Elasticsearch. The engine is widely used in various industries because it provides high performance, real-time and flexibility to meet various search and analysis needs.

3. The difference between ES and traditional relational database

3.1 Data Model

  • Relational databases are used 表格结构, with fixed columns and predefined schemas, requiring the definition of table structures and relationships.
  • Elasticsearch uses 文档模型JSON to represent data, and each document can have a different field structure without a predefined schema. This makes data modeling more flexible and adaptable to unstructured and semi-structured data.

3.2 Query language

  • Relational databases are used 结构化查询语言(SQL)for data query and manipulation.
  • Elasticsearch uses its own query language (Query DSL) to support complex search and analysis operations such as full-text search, filtering, aggregation, and geographic location query. It also provides powerful near-real-time search and analysis capabilities.

3.3 Horizontal scalability

  • Relational databases typically 单服务器run on top of 有限的扩展性. Scaling capacity and throughput often requires hardware upgrades or complex sharding and replication schemes.
  • Elasticsearch is designed 分布式系统to be easy 水平扩展. It shards and distributes the data to multiple nodes, realizing 高可用性、负载均衡和容错性.

3.4 Real-time performance

  • Relational databases can suffer performance degradation on large data volumes or complex queries, especially when multiple tables and join operations are involved.
  • Elasticsearch focuses on real-time performance and can provide high-performance search, aggregation and analysis on large-scale data sets, and the response time is usually in milliseconds.

3.5 Full-text search and full-text indexing

  • Relational databases are often used 索引to improve query performance, but for complex full-text search requirements, performance may not be good.
  • Elasticsearch is an engine specifically 全文搜索和分析designed for, with 内置的全文索引features, capable of processing efficiently 大量文本数据的搜索和匹配.

Overall, Elasticsearch is significantly different from traditional relational databases in terms of data model, query language, scalability, and real-time performance. It is more suitable for processing unstructured, large-scale and real-time data, and provides powerful full-text search, aggregation and analysis functions. Traditional relational databases are more suitable for processing structured data and complex relational queries. The choice of which database to use depends on the specific application requirements and data characteristics


English document learning


What is Elasticsearch? | Elasticsearch Guide [7.9] | Elastic
What is Elasticsearch?

Elasticsearch is the distributed search and analytics engine at the heart of the Elastic Stack. Logstash and Beats facilitate collecting, aggregating, and enriching your data and storing it in Elasticsearch. Kibana enables you to interactively explore, visualize, and share insights into your data and manage and monitor the stack. Elasticsearch is where the indexing, search, and analysis magic happens.

Elasticsearch is the distributed search and analysis engine at the core of the Elastic Stack. Logstash and Beats facilitate the collection, aggregation and enrichment of data and store it in Elasticsearch. Kibana enables you to interactively explore, visualize and share insights from your data, and manage and monitor your entire stack. Elasticsearch is at the heart of indexing, searching, and analytics.


Elasticsearch provides near real-time search and analytics for all types of data. Whether you have structured or unstructured text, numerical data, or geospatial data, Elasticsearch can efficiently store and index it in a way that supports fast searches. You can go far beyond simple data retrieval and aggregate information to discover trends and patterns in your data. And as your data and query volume grows, the distributed nature of Elasticsearch enables your deployment to grow seamlessly right along with it.

Elasticsearch provides near real-time search and analysis capabilities for various types of data. Whether you have structured or unstructured text, numerical or geospatial data, Elasticsearch can efficiently store and index data in a way that supports fast searches. You can go beyond simple data retrieval to discover trends and patterns in data by aggregating information. As data and query volumes grow, the distributed nature of Elasticsearch allows your deployment to scale seamlessly.


While not every problem is a search problem, Elasticsearch offers speed and flexibility to handle data in a wide variety of use cases:

While not every problem is a search problem, Elasticsearch provides speed and flexibility for processing data in a variety of use cases:

  • Add a search box to an app or website
    Add a search box to an app or website
  • Store and analyze logs, metrics, and security event data
    Store and analyze logs, metrics, and security event data
  • Use machine learning to automatically model the behavior of your data in real time
  • Automate business workflows using Elasticsearch as a storage engine
    Automate business workflows using Elasticsearch as a storage engine
  • Manage, integrate, and analyze spatial information using Elasticsearch as a geographic information system (GIS)
    Manage, integrate, and analyze spatial information using Elasticsearch as a geographic information system (GIS)
  • Store and process genetic data using Elasticsearch as a bioinformatics research tool
    Store and process genetic data using Elasticsearch as a bioinformatics research tool

We’re continually amazed by the novel ways people use search. But whether your use case is similar to one of these, or you’re using Elasticsearch to tackle a new problem, the way you work with your data, documents, and indices in Elasticsearch is the same.

We're amazed by the innovative ways people use search. But whether your use cases resemble these, or you're using Elasticsearch to solve a new problem, the way you work with data, documents, and indexes in Elasticsearch is the same.


English sentence analysis


Elasticsearch is the distributed search and analytics engine at the heart of the Elastic Stack

  • Sentence translation: Elasticsearch is the distributed search and analysis engine at the core of the Elastic Stack.

  • translation analysis

    • Elasticsearch: Elasticsearch, translated as "Elasticsearch", is a proper noun without translation.
    • is: is a verb that expresses a state or quality.
    • distributed: 分布式, an adjective, which modifies the "search and analytics engine" behind it.
    • search and analytics: Search and analytics represent the two main functions of Elasticsearch.
    • engine: engine, indicating that Elasticsearch is a tool for performing search and analysis.
    • at the heart of: 在...的核心, indicating that Elasticsearch is at the core of the Elastic Stack.
    • the Elastic Stack: Elastic Stack, translated as "Elastic Stack", is a proper noun that refers to the combination of tools such as Elasticsearch, Logstash, Beats and Kibana.
  • The grammatical structure
    主语is "Elasticsearch", 谓语is "is", 宾语is "distributed search and analytics engine", and "distributed" in the object is 形容词修饰the following "search and analytics engine".


Logstash and Beats facilitate collecting, aggregating, and enriching your data and storing it in Elasticsearch.

  • Sentence translation: Logstash and Beats facilitate the collection, aggregation, enrichment, and storage of data in Elasticsearch.

  • Gramma analysis:

    • facilitate: Verb, to express 促进, to facilitate.
    • collecting: The present participle form of the verb, as the object of facilitate, expresses collection.
    • aggregating: The present participle form of the verb, as the object of facilitate, expresses 聚合.
    • enriching: The present participle form of the verb, as the object of facilitate, expresses 丰富.
    • your: pronoun, that your.
    • data: noun, indicating data. .
    • storing: The present participle form of the verb, as the object of facilitate, expresses storage.
    • it: pronoun, referring to the previously mentioned data.
    • in: preposition, expressing in….
  • Grammatical structure:
    Subject: Logstash and Beats
    Predicate: facilitate
    Object: collecting, aggregating, and enriching your data and storing it in Elasticsearch


Kibana enables you to interactively explore, visualize, and share insights into your data and manage and monitor the stack.

  • Full sentence translation: Kibana enables you to interactively explore, visualize and share data insights, and manage and monitor the entire stack.

  • Gramma analysis

    • Kibana: A proper noun, indicating a data analysis and visualization tool without translation.
    • enables: verb, which means to enable, to enable.
    • interactively: Adverb, expressing with 交互方式.
    • explore: verb, expressing exploration and research.
    • visualize: Verb, express 可视化, graph.
    • share: verb, expressing to share, to share.
    • insights: noun, expression 洞察, opinion.
    • into: preposition, that enters, arrives.
    • and: conjunction, 连接share和manage.
    • manage: verb, expressing management.
    • monitor: verb, express 监控.
    • stack: noun, indicating a stack.
  • Grammatical structure:
    Subject: Kibana
    Verb: enables
    Object: you to interactively explore, visualize, and share insights into your data and manage and monitor the stack


Elasticsearch is where the indexing, search, and analysis magic happens.

  • Full sentence translation: Elasticsearch is where the magic of indexing, searching, and analysis happens.

  • sentence structure analysis

    • Elasticsearch: subject, which represents a tool or system, without translation.
    • is: a linking verb, expressing yes.
    • where: a relative adverb that introduces a clause that expresses a place or situation.
    • the indexing, search, and analysis magic: noun phrase denoting the magic of indexing, search, and analysis.
    • happens: predicate verb, that happens.
  • Sentence structure
    Subject: Elasticsearch
    Verb: is
    Clause: where the indexing, search, and analysis magic happens


Elasticsearch provides near real-time search and analytics for all types of data.

  • Sentence translation: Elasticsearch provides near real-time search and analysis for all types of data.

  • sentence structure analysis

    • Elasticsearch: subject, which represents a tool or system, without translation.
    • provides: predicate verb, express 提供.
    • near real-time searchand analytics: noun phrase, representation 近实时搜索and analysis.
    • for all types of data: a prepositional phrase that applies to all types of data.
  • Sentence structure
    Subject: Elasticsearch
    Verb: provides
    Object: near real-time search and analytics
    Prepositional phrase: for all types of data


Whether you have structured or unstructured text, numerical data, or geospatial data, Elasticsearch can efficiently store and index it in a way that supports fast searches.

  • Full Sentence Translation: Whether you have structured or unstructured text, numeric data, or 地理空间data, Elasticsearch can efficiently store and index them in a way that supports fast searches. .

  • Sentence structure analysis:

    • Whether: A conjunction that introduces a conditional clause.
    • you have structured or unstructured text, numerical data, or geospatial data: noun phrases that denote different types of data.
    • Elasticsearch: subject, which represents a tool or system, without translation.
    • can efficientlystore and index it: predicate verb phrase, which means that it can be stored and indexed efficiently.
    • in a way: a prepositional phrase, expressing in a certain way.
    • that supports fast searches: an attributive clause, modified in a way, expressing support for fast searches.
  • Sentence structure:
    subject: Elasticsearch
    predicate verb phrase: can efficiently store and index it
    prepositional phrase: in a way
    attributive clause: that supports fast searches

You can go far beyond simple data retrieval and aggregate information to discover trends and patterns in your data. And as your data and query volume grows, the distributed nature of Elasticsearch enables your deployment to grow seamlessly right along with it.

  • Full sentence translation: You can go beyond simple data retrieval and aggregate information to discover trends and patterns in data. As your data and query volumes grow, the distributed nature of Elasticsearch allows your deployment to scale seamlessly with it.

  • Sentence structure analysis:

    • You: subject, expressing a person or a group of people, without translation.
    • can go far beyond simple data retrievaland aggregate information: predicate verb phrase that can go beyond simple 数据检索and aggregate information.
    • to discover trends and patternsin your data: Infinitive phrase, as the adverbial of the verb phrase, means to discover in your data 趋势和模式.
    • And: A conjunction that expresses a parallel relationship.
    • as your dataand query volumegrows: clause, leading a time adverbial clause, expressing as your data and 查询量增grows.
    • the distributed nature of Elasticsearchenables your deploymentto grow seamlesslyright along with it: subject clause, which means Elasticsearch的分布式特性that enables your to grow 部署right along with 无缝地it.
  • Sentence structure analysis:
    subject: You
    predicate verb phrase: can go far beyond simple data retrieval and aggregate information
    infinitive phrase: to discover trends and patterns in your data
    conjunction: And
    clause: as your data and query volume grows
    subject clause: the distributed nature of Elasticsearch enables your deployment to grow seamlessly right along with it

Guess you like

Origin blog.csdn.net/qq_29864051/article/details/131426118