ElasticSearch7最新实战文档-附带logstash同步方案

本文涉及的产品
RDS AI 助手,专业版
RDS MySQL DuckDB 分析主实例,集群系列 4核8GB
简介: ElasticSearch7最新实战文档-附带logstash同步方案

索引命令

创建spu索引

PUT /spu_dev
{
"settings": {
       "index": {
         "analysis": {
           "analyzer": {
             "my_ik": {
               "type": "custom",
               "tokenizer": "ik_smart",
               "filter": [
                 "my_synonym"
               ]
             }
           },
           "filter": {
             "my_synonym": {
               "type": "synonym",
               "synonyms_path": "analysis/litong_synonym.txt"
             }
           }
         },
        "number_of_shards":3,
        "number_of_replicas":2
       }
     },
  "mappings": {
    "properties": {
      "productcode": {
        "type": "keyword"
      },
      "productname": {
        "type": "text",
        "analyzer": "ik_max_word"
      },
      "cataname": {
        "type": "text",
        "analyzer": "ik_max_word"
      },
      "cataid": {
        "type": "integer"
      },
      "seriesid": {
        "type": "integer"
      },
      "seriesname":{
        "type": "text",
        "analyzer": "ik_max_word"
      },     
      "multiunitrule": {
        "type": "keyword"
      },
      "brandid": {
        "type": "integer"
      },
      "brandname": {
        "type": "text",
        "analyzer": "ik_max_word"
      },
      "remarks": {
        "type": "text"
      },
      "state": {
        "type": "keyword"
      },
      "oprname":{
        "type": "keyword"
      },
      "pic1":{
        "type": "text"
      },
      "updatetime" : {
          "type" : "date"
      },
      "createtime" : {
          "type" : "date"
      }
    }
  }
}

创建sku索引

PUT /sku_test
{
"settings": {
       "index": {
         "analysis": {
           "analyzer": {
             "my_ik": {
               "type": "custom",
               "tokenizer": "ik_max_word",
               "filter": [
                 "my_synonym"
               ]
             }
           },
           "filter": {
             "my_synonym": {
               "type": "synonym",
               "synonyms_path": "analysis/litong_synonym.txt"
             }
           }
         },
        "number_of_shards":3,
        "number_of_replicas":2
       }
     },
  "mappings": {
    "properties": {
      "productcode": {
        "type": "keyword"
      },
      "productname": {
        "type": "text",
        "analyzer": "ik_max_word"
      },
      "speccode": {
        "type": "keyword"
      },
      "specname": {
        "type": "text",
        "analyzer": "ik_max_word"
      },
      "seriesid": {
        "type": "integer"
      },
      "seriesname":{
        "type": "text",
        "analyzer": "ik_max_word"
      },     
      "multiunitrule": {
        "type": "text"
      },
      "unitname": {
        "type": "text"
      },
      "brandid": {
        "type": "integer"
      },
      "brandname": {
        "type": "text",
        "analyzer": "ik_max_word"
      },
      "remarks": {
        "type": "text"
      },
      "state": {
        "type": "keyword"
      },
      "pic1":{
        "type": "text"
      },
      "updatetime" : {
          "type" : "date"
      },
      "createtime" : {
          "type" : "date"
      },
      "unifiedsaleprice" : {
        "type": "double"
      },
      "salenum" : {
        "type": "double"
      },
      "areaid" : {
        "type" : "integer"
      },
      "areaname" : {
        "type": "text"
      },
      "priceid" : {
        "type": "integer"
      },
      "cataname": {
        "type": "text",
        "analyzer": "ik_max_word"
      },
      "cataid": {
        "type": "integer"
      },
      "categoryid": {
        "type": "integer"
      },
      "servicepricecount": {
        "type": "integer"
      },
      "activitycount": {
        "type": "integer"
      }
    }
  }
}

删除索引

DELETE spu_dev

常用查询命令

统计文档数量

GET /spu_dev/_count

查询文档列表

GET /spu_dev/_search
{
  "query": {
    "match_all": {}
  }
}

分词bool查询

GET /spu_dev/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "match_phrase": {
            "productname": {
              "query": "大",
              "analyzer": "ik_smart"
            }
          }
        }
      ]
    }
  }
}

sku搜索用例

GET /sku_test/_search
{
  "size": 20,
  "query": {
    "bool": {
      "must": [{
        "bool": {
          "should": [{
            "match": {
              "productname": {
                "query": "20红三通",
                "operator": "OR",
                "analyzer": "my_ik",
                "prefix_length": 0,
                "max_expansions": 50,
                "fuzzy_transpositions": true,
                "lenient": false,
                "zero_terms_query": "NONE",
                "auto_generate_synonyms_phrase_query": true,
                "boost": 2.0
              }
            }
          }, {
            "match": {
              "specname": {
                "query": "20红三通",
                "operator": "OR",
                "analyzer": "my_ik",
                "prefix_length": 0,
                "max_expansions": 50,
                "fuzzy_transpositions": true,
                "lenient": false,
                "zero_terms_query": "NONE",
                "auto_generate_synonyms_phrase_query": true,
                "boost": 1.0
              }
            }
          }, {
            "match": {
              "cataname": {
                "query": "20红三通",
                "operator": "OR",
                "analyzer": "my_ik",
                "prefix_length": 0,
                "max_expansions": 50,
                "fuzzy_transpositions": true,
                "lenient": false,
                "zero_terms_query": "NONE",
                "auto_generate_synonyms_phrase_query": true,
                "boost": 2.0
              }
            }
          }],
          "adjust_pure_negative": true,
          "boost": 1.0
        }
      }, {
        "terms": {
          "areaid": [1, 220000, 220200, 220206],
          "boost": 1.0
        }
      }],
      "adjust_pure_negative": true,
      "boost": 1.0
    }
  },
  "sort": [{
    "_score": {
      "order": "desc"
    }
  }, {
    "salenum": {
      "order": "desc"
    }
  }],
  "aggregations": {
    "count": {
      "cardinality": {
        "field": "priceid"
      }
    }
  }
}
GET /sku_test/_search
{
  "size": 20,
  "query": {
    "bool": {
      "must": [{
        "bool": {
          "should": [{
            "match": {
              "productname": {
                "query": "PE给水管",
                "operator": "OR",
                "analyzer": "my_ik",
                "prefix_length": 0,
                "max_expansions": 50,
                "fuzzy_transpositions": true,
                "lenient": false,
                "zero_terms_query": "NONE",
                "auto_generate_synonyms_phrase_query": true,
                "boost": 2.0
              }
            }
          }, {
            "match": {
              "specname": {
                "query": "PE给水管",
                "operator": "OR",
                "analyzer": "my_ik",
                "prefix_length": 0,
                "max_expansions": 50,
                "fuzzy_transpositions": true,
                "lenient": false,
                "zero_terms_query": "NONE",
                "auto_generate_synonyms_phrase_query": true,
                "boost": 1.0
              }
            }
          }, {
            "match": {
              "cataname": {
                "query": "PE给水管",
                "operator": "OR",
                "analyzer": "my_ik",
                "prefix_length": 0,
                "max_expansions": 50,
                "fuzzy_transpositions": true,
                "lenient": false,
                "zero_terms_query": "NONE",
                "auto_generate_synonyms_phrase_query": true,
                "boost": 0.1
              }
            }
          }],
          "adjust_pure_negative": true,
          "boost": 1.0
        }
      }],
      "adjust_pure_negative": true,
      "boost": 1.0
    }
  },
  "sort": [{
    "_score": {
      "order": "desc"
    }
  }, {
    "salenum": {
      "order": "desc"
    }
  }],
  "aggregations": {
    "count": {
      "cardinality": {
        "field": "priceid"
      }
    }
  }
}

删除索引中的全部数据

POST spu_dev/_delete_by_query
{
  "query": {
    "match_all": {}
  }
}

分词

ik分词器

插件列表—analysis-ik—更新词典

同义词

高级配置—同义词配置—更新词典

重建索引

POST _reindex
{
  "source": {
    "index": "source_index"
  },
  "dest": {
    "index": "destination_index"
  }
}

脚本

分词

import jieba
# 读取txt文件
with open("spec.txt", "r", encoding="utf-8") as f:
    text = f.read()
# 将文本内容分成一组单独的字符串
words_list = text.split("\n")
# 分词
results = []
for word in words_list:
    seg_list = jieba.cut_for_search(word)
    results.append("\n".join(seg_list))
# 将分好的词语重新组合成一个字符串
new_text = "\n".join(results)
# 将分好的词语存储在一个新的文件中
with open("spec_dict.txt", "w", encoding="utf-8") as f:
    f.write(new_text)

去重

filename = "spec_dict.txt"
new_filename = "spec_dict_distinct.txt"
unique_words = set()
with open(filename, "r", encoding="utf-8") as f:
    for line in f:
        line = line.strip()
        if line:
            unique_words.add(line)
with open(new_filename, "w", encoding="utf-8") as f:
    for word in unique_words:
        f.write(word + "\n")

注意事项

  • 分词、同义词修改后必须重建索引
  • es索引的字段必须全小写

logstash同步

spu管道-全量

input {
  jdbc {
    jdbc_connection_string => "jdbc:mysql://allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowLoadLocalInfile=false"
    jdbc_user => ""
    jdbc_password => "
    jdbc_driver_library => "/usr/local/service/logstash/extended-files/mysql-connector-java-5.1.40.jar"
    jdbc_driver_class => "com.mysql.jdbc.Driver"
    jdbc_paging_enabled => "true"
    jdbc_page_size => "5000"
    statement => "SELECT DISTINCT
  ep.productCode productcode,
  ep.productName productname,
  ep.seriesId seriesid,
  ep.pic1 pic1,
  ebs.seriesName seriesname,
  fcata.cataName cataname,
  ep.cataId cataid,
  ep.multiUnitRule multiunitrule,
  ep.brandId brandid,
  eb.brandName brandname,
  ep.remarks remarks,
  ep.state state,
  sa.nickName oprname,
  ep.createTime createtime,
  ep.updateTime updatetime
FROM
  t_erp_product ep
  LEFT JOIN (
  SELECT
    ecr.subCataId 'cataId',
    ec.cataName 'subCataName',
    GROUP_CONCAT( fec.cataName ORDER BY ecr.subLevel DESC SEPARATOR ' > ' ) 'cataName' 
  FROM
    t_erp_cata_relation ecr
    LEFT JOIN t_erp_cata ec ON ecr.subCataId = ec.cataId
    LEFT JOIN t_erp_cata fec ON ecr.cataId = fec.cataId 
  GROUP BY
    ecr.subCataId 
  ) fcata ON ep.cataId = fcata.cataId
  LEFT JOIN t_erp_brand eb ON ep.brandId = eb.brandId
  LEFT JOIN t_erp_brandseries ebs ON ep.seriesId = ebs.seriesId
  LEFT JOIN t_sys_account sa ON sa.accId = ep.oprId
  LEFT JOIN t_erp_productspec eps ON eps.productCode = ep.productCode 
WHERE
  ep.state != 'D' and ep.updateTime > :sql_last_value"
    use_column_value => true
    tracking_column => "updatetime"
  tracking_column_type => "timestamp"
    schedule => "* * * * *"
    last_run_metadata_path => "/usr/local/service/logstash/temp/gd_spu_dev_sql_last_value.yml"
    type => "jdbc"
  }
}
output {
    elasticsearch {
        hosts => ""
        user => ""
    index => ""
        password => ""
    document_id => "%{productcode}"
    }
}

spu管道-增量

input {
  jdbc {
    jdbc_connection_string => "jdbc:mysql:///lt_uat_db?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowLoadLocalInfile=false"
    jdbc_user => "
    jdbc_password => ""
    jdbc_driver_library => "/usr/local/service/logstash/extended-files/mysql-connector-java-5.1.40.jar"
    jdbc_driver_class => "com.mysql.jdbc.Driver"
    jdbc_paging_enabled => "true"
    jdbc_page_size => "5000"
    statement => "SELECT DISTINCT
  ep.productCode productcode,
  ep.productName productname,
  ep.seriesId seriesid,
  ep.pic1 pic1,
  ebs.seriesName seriesname,
  fcata.cataName cataname,
  ep.cataId cataid,
  ep.multiUnitRule multiunitrule,
  ep.brandId brandid,
  eb.brandName brandname,
  ep.remarks remarks,
  ep.state state,
  sa.nickName oprname,
  ep.createTime createtime,
  ep.updateTime updatetime
FROM
  t_erp_product ep
  LEFT JOIN (
  SELECT
    ecr.subCataId 'cataId',
    ec.cataName 'subCataName',
    GROUP_CONCAT( fec.cataName ORDER BY ecr.subLevel DESC SEPARATOR ' > ' ) 'cataName' 
  FROM
    t_erp_cata_relation ecr
    LEFT JOIN t_erp_cata ec ON ecr.subCataId = ec.cataId
    LEFT JOIN t_erp_cata fec ON ecr.cataId = fec.cataId 
  GROUP BY
    ecr.subCataId 
  ) fcata ON ep.cataId = fcata.cataId
  LEFT JOIN t_erp_brand eb ON ep.brandId = eb.brandId
  LEFT JOIN t_erp_brandseries ebs ON ep.seriesId = ebs.seriesId
  LEFT JOIN t_sys_account sa ON sa.accId = ep.oprId
  LEFT JOIN t_erp_productspec eps ON eps.productCode = ep.productCode 
WHERE
  ep.state != 'D' and ep.updateTime > :sql_last_value"
    use_column_value => true
    tracking_column => "updatetime"
  tracking_column_type => "timestamp"
    schedule => "* * * * *"
    last_run_metadata_path => "/usr/local/service/logstash/temp/gd_spu_dev_sql_last_value.yml"
    type => "jdbc"
  }
}
output {
    elasticsearch {
        hosts => ""
        user => ""
    index => ""
        password => ""
    document_id => "%{productcode}"
    }
}

sku管道-全量

input {
  jdbc {
    jdbc_connection_string => "jdbc:mysql:///lt_uat_db?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowLoadLocalInfile=false"
    jdbc_user => ""
    jdbc_password => ""
    jdbc_driver_library => "/usr/local/service/logstash/extended-files/mysql-connector-java-5.1.40.jar"
    jdbc_driver_class => "com.mysql.jdbc.Driver"
    jdbc_paging_enabled => "true"
    jdbc_page_size => "5000"
    statement => "SELECT
  ep.productCode productcode,
  ep.productName productname,
  eps.specCode speccode,
  eps.specName specname,
  ep.seriesId seriesid,
  ep.pic1 pic1,
  ebs.seriesName seriesname,
  ep.multiUnitRule multiunitrule,
  ep.unitName unitname,
  ep.brandId brandid,
  eb.brandName brandname,
  eps.remarks remarks,
  ep.state state,
  eps.createTime createtime,
  eps.updateTime updatetime,
  sa.areaName areaname,
  sa.areaId areaid,
  eup.unifiedSalePrice unifiedsaleprice,
  eup.priceId priceid,
  IFNULL( t.salenum, 0 ) salenum,
  (
        SELECT COUNT(1)
        FROM t_erp_costprice ecp
        WHERE ecp.state = 'A'
        AND ecp.supplierCode IN (SELECT supplierCode FROM t_wms_supplier_setting WHERE showTag = 1)
        AND ecp.specCode = eup.specCode
        AND ecp.areaId IN (SELECT areaId FROM t_sys_area_relation WHERE subAreaId = eup.areaId)
        ) servicepricecount,
  COALESCE((SELECT COUNT(1) 'activityCount'
    FROM t_erp_activity_product eap
    LEFT JOIN t_erp_activity ea ON eap.activityId = ea.activityId
    WHERE ea.state = 'A'
    AND NOW() BETWEEN ea.validStart AND ea.validEnd
    AND (SELECT COUNT(1) FROM t_sys_area_relation WHERE FIND_IN_SET(areaId,ea.areaIds) AND subAreaId = eup.areaId) > 0
    AND eap.specCode = eup.specCode
    GROUP BY eap.specCode),0) activitycount
FROM
  t_erp_product ep
  LEFT JOIN t_erp_brand eb ON ep.brandId = eb.brandId
  LEFT JOIN t_erp_brandseries ebs ON ep.seriesId = ebs.seriesId
  LEFT JOIN t_erp_productspec eps ON eps.productCode = ep.productCode
  LEFT JOIN t_erp_unified_price eup ON eps.specCode = eup.specCode
  LEFT JOIN t_sys_area sa ON eup.areaId = sa.areaId
  LEFT JOIN ( SELECT sum( itemNum ) salenum, specCode FROM t_erp_saleproduct GROUP BY specCode ) t ON t.specCode = eps.specCode
WHERE
  ep.state != 'D' 
  AND eup.unifiedSalePrice IS NOT NULL 
GROUP BY
  priceid"
    type => "jdbc"
  }
}
output {
    elasticsearch {
        hosts => 
        user => ""
    index => ""
        password => ""
    document_id => "%{priceid}"
    }
}

sku管道-增量

SELECT
  ep.productCode productcode,
  ep.productName productname,
  eps.specCode speccode,
  eps.specName specname,
  ep.seriesId seriesid,
  ep.pic1 pic1,
  ebs.seriesName seriesname,
  ep.multiUnitRule multiunitrule,
  ep.unitName unitname,
  ep.brandId brandid,
  eb.brandName brandname,
  eps.remarks remarks,
  ep.state state,
  eps.createTime createtime,
  eps.updateTime updatetime,
  sa.areaName areaname,
  sa.areaId areaid,
  eup.unifiedSalePrice unifiedsaleprice,
  eup.priceId priceid,
  ep.cataId cataid,
  ec.cataName cataname,
  IFNULL( t.salenum, 0 ) salenum,
  (
        SELECT COUNT(1)
        FROM t_erp_costprice ecp
        WHERE ecp.state = 'A'
        AND ecp.supplierCode IN (SELECT supplierCode FROM t_wms_supplier_setting WHERE showTag = 1)
        AND ecp.specCode = eup.specCode
        AND ecp.areaId IN (SELECT areaId FROM t_sys_area_relation WHERE subAreaId = eup.areaId)
        ) servicepricecount,
  COALESCE((SELECT COUNT(1) 'activityCount'
    FROM t_erp_activity_product eap
    LEFT JOIN t_erp_activity ea ON eap.activityId = ea.activityId
    WHERE ea.state = 'A'
    AND NOW() BETWEEN ea.validStart AND ea.validEnd
    AND (SELECT COUNT(1) FROM t_sys_area_relation WHERE FIND_IN_SET(areaId,ea.areaIds) AND subAreaId = eup.areaId) > 0
    AND eap.specCode = eup.specCode
    GROUP BY eap.specCode),0) activitycount
FROM
  t_erp_product ep
  LEFT JOIN t_erp_brand eb ON ep.brandId = eb.brandId
  LEFT JOIN t_erp_brandseries ebs ON ep.seriesId = ebs.seriesId
  LEFT JOIN t_erp_productspec eps ON eps.productCode = ep.productCode
  LEFT JOIN t_erp_unified_price eup ON eps.specCode = eup.specCode
  LEFT JOIN t_sys_area sa ON eup.areaId = sa.areaId
  LEFT JOIN ( SELECT sum( itemNum ) salenum, specCode FROM t_erp_saleproduct GROUP BY specCode ) t ON t.specCode = eps.specCode
  LEFT JOIN t_erp_cata ec ON ec.cataId = ep.cataId
  INNER JOIN t_erp_costprice cs ON cs.specCode = eps.specCode
WHERE
  ep.state = 'A' 
  AND eup.unifiedSalePrice IS NOT NULL
  AND cs.state = 'A'
  AND eps.updateTime > :sql_last_value
GROUP BY
  priceid

注意事项

  • logstash同步数据库只能同步内网的,不支持外网
  • es不能用驼峰或者下划线,否则会同步失败
  • 要指定文档id,否则会一直增加重复文档
  • 使用增量同步时,配置的yml文件名不能相同,可以自定义

同步命令使用示例

  • 先删除原有的索引
DELETE sku_test
  • 然后创建新索引
PUT /sku_test
{
"settings": {
       "index": {
         "analysis": {
           "analyzer": {
             "my_ik": {
               "type": "custom",
               "tokenizer": "ik_max_word",
               "filter": [
                 "my_synonym"
               ]
             }
           },
           "filter": {
             "my_synonym": {
               "type": "synonym",
               "synonyms_path": "analysis/litong_synonym.txt"
             }
           }
         },
        "number_of_shards":3,
        "number_of_replicas":2
       }
     },
  "mappings": {
    "properties": {
      "productcode": {
        "type": "keyword"
      },
      "productname": {
        "type": "text",
        "analyzer": "ik_max_word"
      },
      "speccode": {
        "type": "keyword"
      },
      "specname": {
        "type": "text",
        "analyzer": "ik_max_word"
      },
      "seriesid": {
        "type": "integer"
      },
      "seriesname":{
        "type": "text",
        "analyzer": "ik_max_word"
      },     
      "multiunitrule": {
        "type": "text"
      },
      "unitname": {
        "type": "text"
      },
      "brandid": {
        "type": "integer"
      },
      "brandname": {
        "type": "text",
        "analyzer": "ik_max_word"
      },
      "remarks": {
        "type": "text"
      },
      "state": {
        "type": "keyword"
      },
      "pic1":{
        "type": "text"
      },
      "updatetime" : {
          "type" : "date"
      },
      "createtime" : {
          "type" : "date"
      },
      "unifiedsaleprice" : {
        "type": "double"
      },
      "salenum" : {
        "type": "double"
      },
      "areaid" : {
        "type" : "integer"
      },
      "areaname" : {
        "type": "text"
      },
      "priceid" : {
        "type": "integer"
      },
      "cataname": {
        "type": "text",
        "analyzer": "ik_max_word"
      },
      "cataid": {
        "type": "integer"
      },
      "categoryid": {
        "type": "integer"
      },
      "servicepricecount": {
        "type": "integer"
      },
      "activitycount": {
        "type": "integer"
      }
    }
  }
}
  • 最后执行命令查看是否同步成功,如果有数据就说明同步成功
GET /sku_test/_count

本地调试的时候需要注意

如果有碰到访问不了es、403等问题,说明没有配es的防火墙

首先要登入腾讯云es的控制台,注意是上海的服务器

然后点击管理集群

点击实例名称进入

点击访问控制

然后点击修改白名单

直接点获取当前ip即可,如果ip满了,就删掉几个没用的,因为公司的ip会经常变

一路确认

保存了之后,如果还是不生效,那么此时就需要重启集群

点击左上角箭头返回

更多里面有重启

尽量选择滚动重启,如果全量重启的话,会影响线上环境,如果追求速度的话就可以点全量重启

等待重启即可,滚动重启一般需要5-7分钟

相关实践学习
以电商场景为例搭建AI语义搜索应用
本实验旨在通过阿里云Elasticsearch结合阿里云搜索开发工作台AI模型服务,构建一个高效、精准的语义搜索系统,模拟电商场景,深入理解AI搜索技术原理并掌握其实现过程。
ElasticSearch 最新快速入门教程
本课程由千锋教育提供。全文搜索的需求非常大。而开源的解决办法Elasricsearch(Elastic)就是一个非常好的工具。目前是全文搜索引擎的首选。本系列教程由浅入深讲解了在CentOS7系统下如何搭建ElasticSearch,如何使用Kibana实现各种方式的搜索并详细分析了搜索的原理,最后讲解了在Java应用中如何集成ElasticSearch并实现搜索。  
目录
相关文章
|
3月前
|
缓存 监控 前端开发
顺企网 API 开发实战:搜索 / 详情接口从 0 到 1 落地(附 Elasticsearch 优化 + 错误速查)
企业API开发常陷参数、缓存、错误处理三大坑?本指南拆解顺企网双接口全流程,涵盖搜索优化、签名验证、限流应对,附可复用代码与错误速查表,助你2小时高效搞定开发,提升响应速度与稳定性。
|
8月前
|
存储 监控 数据可视化
可观测性方案怎么选?SelectDB vs Elasticsearch vs ClickHouse
基于 SelectDB 的高性能倒排索引、高吞吐量写入和高压缩存储,用户可以构建出性能高于Elasticsearch 10 倍的可观测性平台,并支持国内外多个云上便捷使用 SelectDB Cloud 的开箱即用服务。
464 8
可观测性方案怎么选?SelectDB vs Elasticsearch vs ClickHouse
|
存储 运维 监控
超越传统模型:从零开始构建高效的日志分析平台——基于Elasticsearch的实战指南
【10月更文挑战第8天】随着互联网应用和微服务架构的普及,系统产生的日志数据量日益增长。有效地收集、存储、检索和分析这些日志对于监控系统健康状态、快速定位问题以及优化性能至关重要。Elasticsearch 作为一种分布式的搜索和分析引擎,以其强大的全文检索能力和实时数据分析能力成为日志处理的理想选择。
938 6
|
10月前
|
存储 SQL Apache
为什么 Apache Doris 是比 Elasticsearch 更好的实时分析替代方案?
本文将从技术选型的视角,从开放性、系统架构、实时写入、实时存储、实时查询等多方面,深入分析 Apache Doris 与 Elasticsearch 的能力差异及性能表现
1190 17
为什么 Apache Doris 是比 Elasticsearch 更好的实时分析替代方案?
|
9月前
|
人工智能 自然语言处理 运维
让搜索引擎“更懂你”:AI × Elasticsearch MCP Server 开源实战
本文介绍基于Model Context Protocol (MCP)标准的Elasticsearch MCP Server,它为AI助手(如Claude、Cursor等)提供与Elasticsearch数据源交互的能力。文章涵盖MCP概念、Elasticsearch MCP Server的功能特性及实际应用场景,例如数据探索、开发辅助。通过自然语言处理,用户无需掌握复杂查询语法即可操作Elasticsearch,显著降低使用门槛并提升效率。项目开源地址:<https://github.com/awesimon/elasticsearch-mcp>,欢迎体验与反馈。
2512 1
ELK 圣经:Elasticsearch、Logstash、Kibana 从入门到精通
ELK是一套强大的日志管理和分析工具,广泛应用于日志监控、故障排查、业务分析等场景。本文档将详细介绍ELK的各个组件及其配置方法,帮助读者从零开始掌握ELK的使用。
|
存储 监控 安全
|
存储 自然语言处理 关系型数据库
ElasticSearch基础3——聚合、补全、集群。黑马旅游检索高亮+自定义分词器+自动补全+前后端消息同步
聚合、补全、RabbitMQ消息同步、集群、脑裂问题、集群分布式存储、黑马旅游实现过滤和搜索补全功能
ElasticSearch基础3——聚合、补全、集群。黑马旅游检索高亮+自定义分词器+自动补全+前后端消息同步
|
JSON 自然语言处理 算法
ElasticSearch基础2——DSL查询文档,黑马旅游项目查询功能
DSL查询文档、RestClient查询文档、全文检索查询、精准查询、复合查询、地理坐标查询、分页、排序、高亮、黑马旅游案例
ElasticSearch基础2——DSL查询文档,黑马旅游项目查询功能
|
JSON 自然语言处理 数据库
ElasticSearch基础1——索引和文档。Kibana,RestClient操作索引和文档+黑马旅游ES库导入
概念、ik分词器、倒排索引、索引和文档的增删改查、RestClient对索引和文档的增删改查
ElasticSearch基础1——索引和文档。Kibana,RestClient操作索引和文档+黑马旅游ES库导入

热门文章

最新文章