ElasticSearch8.x操作记录

这篇具有很好参考价值的文章主要介绍了ElasticSearch8.x操作记录。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

ElasticSearch8.x操作记录

文档内容来自于尚硅谷海波老师的ElasticSearch教程课,在Kibana中的一些操作演示

以下为在文档中的相关操作记录

1.索引操作

#创建索引
#PUT 索引名称
PUT test_index

#PUT 索引
#增加配置:JSON格式的主题内容
PUT test_index_1
{
  "aliases": {
    "test1": {}
  }
}

#删除索引
#delete 索引名称
DELETE test_index_1

#修改索引配置
#ES不允许修改索引信息
POST test_index_1
{
  "aliases": {
    "test1": {}
  }
}

#HEAD索引 (判读索引是否存在)HTTP状态码 200404
HEAD test_index

#查询索引
GET test_index
GET test_index_1
GET test1

#查询所有索引
GET _cat/indices

#创建文档(索引数据)--增加唯一性标识(手动:PUT,后面需要自己添加/自动;POST自动生成,不需要再后面添加)
#首先需要先创建索引
PUT index_doc

PUT index_doc/_doc/1001
{
  "id": 1001,
  "name": "zhangsan",
  "age": 30
}

POST index_doc/_doc
{
  "id": 1002,
  "name": "lisi",
  "age": 14
}

2.文档操作

#查询文档
GET index_doc/_doc/1001

#查询当前索引中所有的文档数据
GET index_doc/_search

#修改文档数据
PUT index_doc/_doc/1001
{
  "id": 100111,
  "name": "zhangsan",
  "age": 30,
  "tel": "15123392594"
}
#POST修改数据
POST index_doc/_doc/okBdhIQB7PHEeADHmDqa
{
  "id": 1003,
  "name": "wangwu",
  "age": 22
}

#删除数据
DELETE index_doc/_doc/okBdhIQB7PHEeADHmDqa

#以下操作是不被允许的
DELETE index_doc/_doc

3.文档搜索

#增加索引
PUT test_query

DELETE test_query
#添加数据
PUT test_query/_bulk
{"index":{"_index": "test_query", "_id":"1001"}}
{"id":"1001", "name": "zhang san", "age": 30}
{"index":{"_index": "test_query", "_id":"1002"}}
{"id":"1002", "name": "li si", "age": 40}
{"index":{"_index": "test_query", "_id":"1003"}}
{"id":"1003", "name": "wang wu", "age": 50}
{"index":{"_index": "test_query", "_id":"1004"}}
{"id":"1004", "name": "zhangsan", "age": 30}
{"index":{"_index": "test_query", "_id":"1005"}}
{"id":"1005", "name": "lisi", "age": 40}
{"index":{"_index": "test_query", "_id":"1006"}}
{"id":"1006", "name": "wangwu", "age": 50}

#Match是分词查询,ES会将数据分词(关键词)保存
#zhang san
GET test_query/_search
{
  "query": {
    "match": {
      "name": "zhang san"
    }
  }
}

GET test_query/_search
{
  "query": {
    "term": {
      "name": {
        "value": "zhang san"
      }
    }
  }
}

#对查询结果字段进行限制
GET test_query/_search
{
  "_source": ["name", "age"], 
  "query": {
    "match": {
      "name": "zhang san"
    }
  }
}

#组合多个条件 or
GET test_query/_search
{
  "query": {
    "bool": {
      "should": [
        {
          "match": {
            "name": "zhang"
          }
        },
        {
          "match": {
            "age": "40"
          }
        }
      ]
    }
  }
}

# 排序后查询
GET test_query/_search
{
  "query": {
    "match": {
      "name": "zhang li"
    }
  },
  "sort": [
    {
      "age": {
        "order": "desc"
      }
    }
  ]
}

#分页查询
GET test_query/_search
{
  "query": {
    "match_all": {}
  },
  "from": 4,
  "size": 2
}

4.聚合搜索

# 分组查询
GET test_query/_search
{
  "aggs": {
    "ageGroup": {
      "terms": {
        "field": "age"
      }
    }
  },
  "size": 0
}

# 分组后聚合(求和)
GET test_query/_search
{
  "aggs": {
    "ageGroup": {
      "terms": {
        "field": "age"
      },
      "aggs": {
        "ageSum": {
          "sum": {
            "field": "age"
          }
        }
      }
    }
  },
  "size": 0
}

# 求年龄平均值
GET test_query/_search
{
  "aggs": {
    "avgAge": {
      "avg": {
        "field": "age"
      }
    }
  },
  "size": 0
}

# 获取前几名操作
GET test_query/_search
{
  "aggs": {
    "top3": {
      "top_hits": {
        "sort": [
          {
            "age": {
            "order": "desc"
          }
          }
        ], 
        "size": 3
      }
    }
  },
  "size": 0
}

5.索引模板

PUT test_temp

GET test_temp

PUT test_temp_1
{
  "settings": {
    "number_of_shards": 2
  }
}

GET test_temp_1

#创建模板
PUT _template/mytemplate
{
  "index_patterns": [
    "my*"  
  ],
  "settings": {
    "index": {
      "number_of_shards" : "2"
    }
  },
  "mappings": {
    "properties": {
      "now": {
        "type": "date",
        "format": "yyyy/MM/dd"
      }
    }
  }
}

#查看模板
GET _template/mytemplate

PUT test_temp_2
GET test_temp_2

# 匹配模板规则,以my开头
PUT my_test_temp
GET my_test_temp

#删除模板
DELETE _template/mytemplate

6.中文分词

#分词操作
GET _analyze
{
  "analyzer": "standard", 
  "text": ["zhang san"]
}

# 分词操作(不带插件情况下,中文拆分逻辑太适合)
GET _analyze
{
  "analyzer": "chinese", 
  "text": ["我是一个三好学生"]
}

# 集成了IK插件后提供的分词
GET _analyze
{
  "analyzer": "ik_smart", 
  "text": ["我是一个三好学生"]
}

# 集成了IK插件后提供的分词,相较于上者,分得更加精细
GET _analyze
{
  "analyzer": "ik_max_word", 
  "text": ["我是一个三好学生"]
}

7.文档评分机制

PUT test_score

PUT test_score/_doc/1001
{
  "text": "zhang kai shou bi, yin jie tai yang"
}

PUT test_score/_doc/1002
{
  "text": "zhang san"
}

GET test_score/_search?explain=true
{
  "query": {
    "match": {
      "text": "zhang"
    }
  }
}
# 公式如下
boost * idf * tf = 2.2 * 0.18232156 * 0.6024096

PUT itwluo

PUT itwluo/_doc/1001
{
  "text": "java"
}

GET itwluo/_search
{
  "query": {
    "match": {
      "text": "java"
    }
  }
}

#result
{
  "took": 992,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 1,
      "relation": "eq"
    },
    "max_score": 0.2876821,
    "hits": [
      {
        "_index": "itwluo",
        "_id": "1001",
        "_score": 0.2876821,
        "_source": {
          "text": "java"
        }
      }
    ]
  }
}

#详细结果
{
  "took": 3,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 1,
      "relation": "eq"
    },
    "max_score": 0.2876821,
    "hits": [
      {
        "_shard": "[itwluo][0]",
        "_node": "EX7ZCQpSRLu-OWEZjQazog",
        "_index": "itwluo",
        "_id": "1001",
        "_score": 0.2876821,
        "_source": {
          "text": "java"
        },
        "_explanation": {
          "value": 0.2876821,
          "description": "weight(text:java in 0) [PerFieldSimilarity], result of:",
          "details": [
            {
              "value": 0.2876821,
              "description": "score(freq=1.0), computed as boost * idf * tf from:",
              "details": [
                {
                  "value": 2.2,
                  "description": "boost",
                  "details": []
                },
                {
                  "value": 0.2876821,
                  "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                  "details": [
                    {
                      "value": 1,
                      "description": "n, number of documents containing term",
                      "details": []
                    },
                    {
                      "value": 1,
                      "description": "N, total number of documents with field",
                      "details": []
                    }
                  ]
                },
                {
                  "value": 0.45454544,
                  "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                  "details": [
                    {
                      "value": 1,
                      "description": "freq, occurrences of term within document",
                      "details": []
                    },
                    {
                      "value": 1.2,
                      "description": "k1, term saturation parameter",
                      "details": []
                    },
                    {
                      "value": 0.75,
                      "description": "b, length normalization parameter",
                      "details": []
                    },
                    {
                      "value": 1,
                      "description": "dl, length of field",
                      "details": []
                    },
                    {
                      "value": 1,
                      "description": "avgdl, average length of field",
                      "details": []
                    }
                  ]
                }
              ]
            }
          ]
        }
      }
    ]
  }
}

#新增数据后,观察分值变化
PUT itwluo/_doc/1002
{
  "text": "java bigdata"
}

#查询文档数据
GET itwluo/_search?explain=true
{
  "query": {
    "match": {
      "text": "java"
    }
  }
}

#详细结果
{
  "took": 609,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 2,
      "relation": "eq"
    },
    "max_score": 0.21110919,
    "hits": [
      {
        "_shard": "[itwluo][0]",
        "_node": "EX7ZCQpSRLu-OWEZjQazog",
        "_index": "itwluo",
        "_id": "1001",
        "_score": 0.21110919,
        "_source": {
          "text": "java"
        },
        "_explanation": {
          "value": 0.21110919,
          "description": "weight(text:java in 0) [PerFieldSimilarity], result of:",
          "details": [
            {
              "value": 0.21110919,
              "description": "score(freq=1.0), computed as boost * idf * tf from:",
              "details": [
                {
                  "value": 2.2,
                  "description": "boost",
                  "details": []
                },
                {
                  "value": 0.18232156,
                  "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                  "details": [
                    {
                      "value": 2,
                      "description": "n, number of documents containing term",
                      "details": []
                    },
                    {
                      "value": 2,
                      "description": "N, total number of documents with field",
                      "details": []
                    }
                  ]
                },
                {
                  "value": 0.5263158,
                  "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                  "details": [
                    {
                      "value": 1,
                      "description": "freq, occurrences of term within document",
                      "details": []
                    },
                    {
                      "value": 1.2,
                      "description": "k1, term saturation parameter",
                      "details": []
                    },
                    {
                      "value": 0.75,
                      "description": "b, length normalization parameter",
                      "details": []
                    },
                    {
                      "value": 1,
                      "description": "dl, length of field",
                      "details": []
                    },
                    {
                      "value": 1.5,
                      "description": "avgdl, average length of field",
                      "details": []
                    }
                  ]
                }
              ]
            }
          ]
        }
      },
      {
        "_shard": "[itwluo][0]",
        "_node": "EX7ZCQpSRLu-OWEZjQazog",
        "_index": "itwluo",
        "_id": "1002",
        "_score": 0.160443,
        "_source": {
          "text": "java bigdata"
        },
        "_explanation": {
          "value": 0.160443,
          "description": "weight(text:java in 0) [PerFieldSimilarity], result of:",
          "details": [
            {
              "value": 0.160443,
              "description": "score(freq=1.0), computed as boost * idf * tf from:",
              "details": [
                {
                  "value": 2.2,
                  "description": "boost",
                  "details": []
                },
                {
                  "value": 0.18232156,
                  "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                  "details": [
                    {
                      "value": 2,
                      "description": "n, number of documents containing term",
                      "details": []
                    },
                    {
                      "value": 2,
                      "description": "N, total number of documents with field",
                      "details": []
                    }
                  ]
                },
                {
                  "value": 0.40000004,
                  "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                  "details": [
                    {
                      "value": 1,
                      "description": "freq, occurrences of term within document",
                      "details": []
                    },
                    {
                      "value": 1.2,
                      "description": "k1, term saturation parameter",
                      "details": []
                    },
                    {
                      "value": 0.75,
                      "description": "b, length normalization parameter",
                      "details": []
                    },
                    {
                      "value": 2,
                      "description": "dl, length of field",
                      "details": []
                    },
                    {
                      "value": 1.5,
                      "description": "avgdl, average length of field",
                      "details": []
                    }
                  ]
                }
              ]
            }
          ]
        }
      }
    ]
  }
}

# 在上述数据基础上继续添加数据,分析结果
PUT itwluo/_doc/1003
{
  "text": "bigdata",
  "content": "java bigdata"
}

# 详细计算结果
{
  "took": 599,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 2,
      "relation": "eq"
    },
    "max_score": 0.52354836,
    "hits": [
      {
        "_shard": "[itwluo][0]",
        "_node": "EX7ZCQpSRLu-OWEZjQazog",
        "_index": "itwluo",
        "_id": "1001",
        "_score": 0.52354836,
        "_source": {
          "text": "java"
        },
        "_explanation": {
          "value": 0.52354836,
          "description": "weight(text:java in 0) [PerFieldSimilarity], result of:",
          "details": [
            {
              "value": 0.52354836,
              "description": "score(freq=1.0), computed as boost * idf * tf from:",
              "details": [
                {
                  "value": 2.2,
                  "description": "boost",
                  "details": []
                },
                {
                  "value": 0.47000363,
                  "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                  "details": [
                    {
                      "value": 2,
                      "description": "n, number of documents containing term",
                      "details": []
                    },
                    {
                      "value": 3,
                      "description": "N, total number of documents with field",
                      "details": []
                    }
                  ]
                },
                {
                  "value": 0.50632906,
                  "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                  "details": [
                    {
                      "value": 1,
                      "description": "freq, occurrences of term within document",
                      "details": []
                    },
                    {
                      "value": 1.2,
                      "description": "k1, term saturation parameter",
                      "details": []
                    },
                    {
                      "value": 0.75,
                      "description": "b, length normalization parameter",
                      "details": []
                    },
                    {
                      "value": 1,
                      "description": "dl, length of field",
                      "details": []
                    },
                    {
                      "value": 1.3333334,
                      "description": "avgdl, average length of field",
                      "details": []
                    }
                  ]
                }
              ]
            }
          ]
        }
      },
      {
        "_shard": "[itwluo][0]",
        "_node": "EX7ZCQpSRLu-OWEZjQazog",
        "_index": "itwluo",
        "_id": "1002",
        "_score": 0.39019167,
        "_source": {
          "text": "java bigdata"
        },
        "_explanation": {
          "value": 0.39019167,
          "description": "weight(text:java in 0) [PerFieldSimilarity], result of:",
          "details": [
            {
              "value": 0.39019167,
              "description": "score(freq=1.0), computed as boost * idf * tf from:",
              "details": [
                {
                  "value": 2.2,
                  "description": "boost",
                  "details": []
                },
                {
                  "value": 0.47000363,
                  "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                  "details": [
                    {
                      "value": 2,
                      "description": "n, number of documents containing term",
                      "details": []
                    },
                    {
                      "value": 3,
                      "description": "N, total number of documents with field",
                      "details": []
                    }
                  ]
                },
                {
                  "value": 0.37735844,
                  "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                  "details": [
                    {
                      "value": 1,
                      "description": "freq, occurrences of term within document",
                      "details": []
                    },
                    {
                      "value": 1.2,
                      "description": "k1, term saturation parameter",
                      "details": []
                    },
                    {
                      "value": 0.75,
                      "description": "b, length normalization parameter",
                      "details": []
                    },
                    {
                      "value": 2,
                      "description": "dl, length of field",
                      "details": []
                    },
                    {
                      "value": 1.3333334,
                      "description": "avgdl, average length of field",
                      "details": []
                    }
                  ]
                }
              ]
            }
          ]
        }
      }
    ]
  }
    
# 通过提高权重,从而提高分数,使排名靠前
DELETE test_score

PUT test_score

PUT /test_score/_doc/1001
{
  "title": "Hadoop is a FrameWork",
  "content": "Hadoop 是一个大数据基础框架"
}

PUT /test_score/_doc/1002
{
  "title": "Hive is a SQL Tools",
  "content": "Hive是一个SQL工具"
}

PUT /test_score/_doc/1003
{
  "title": "Spark is a FrameWork",
  "content": "Spark 是一个分布式计算引擎"
}

GET test_score/_search?explain=true
{
  "query": {
    "bool": {
      "should": [
        {
          "match": {
            "title": {
              "query": "Hadoop", "boost": 1
            }
          }
        },
        {
          "match": {
            "title": {
              "query": "Hive", "boost": 2
            }
          }
        },
        {
          "match": {
            "title": {
              "query": "Spark", "boost": 1
            }
          }
        }
      ]
    }
  }
}

# 详细结果分析
{
  "took": 4,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 3,
      "relation": "eq"
    },
    "max_score": 2.2458146,
    "hits": [
      {
        "_shard": "[test_score][0]",
        "_node": "EX7ZCQpSRLu-OWEZjQazog",
        "_index": "test_score",
        "_id": "1002",
        "_score": 2.2458146,
        "_source": {
          "title": "Hive is a SQL Tools",
          "content": "Hive是一个SQL工具"
        },
        "_explanation": {
          "value": 2.2458146,
          "description": "sum of:",
          "details": [
            {
              "value": 2.2458146,
              "description": "weight(title:hive in 0) [PerFieldSimilarity], result of:",
              "details": [
                {
                  "value": 2.2458146,
                  "description": "score(freq=1.0), computed as boost * idf * tf from:",
                  "details": [
                    {
                      "value": 4.4,
                      "description": "boost",
                      "details": []
                    },
                    {
                      "value": 1.2039728,
                      "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                      "details": [
                        {
                          "value": 1,
                          "description": "n, number of documents containing term",
                          "details": []
                        },
                        {
                          "value": 4,
                          "description": "N, total number of documents with field",
                          "details": []
                        }
                      ]
                    },
                    {
                      "value": 0.42394012,
                      "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                      "details": [
                        {
                          "value": 1,
                          "description": "freq, occurrences of term within document",
                          "details": []
                        },
                        {
                          "value": 1.2,
                          "description": "k1, term saturation parameter",
                          "details": []
                        },
                        {
                          "value": 0.75,
                          "description": "b, length normalization parameter",
                          "details": []
                        },
                        {
                          "value": 5,
                          "description": "dl, length of field",
                          "details": []
                        },
                        {
                          "value": 4.25,
                          "description": "avgdl, average length of field",
                          "details": []
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      },
      {
        "_shard": "[test_score][0]",
        "_node": "EX7ZCQpSRLu-OWEZjQazog",
        "_index": "test_score",
        "_id": "1003",
        "_score": 1.2336599,
        "_source": {
          "title": "Spark is a FrameWork",
          "content": "Spark 是一个分布式计算引擎"
        },
        "_explanation": {
          "value": 1.2336599,
          "description": "sum of:",
          "details": [
            {
              "value": 1.2336599,
              "description": "weight(title:spark in 2) [PerFieldSimilarity], result of:",
              "details": [
                {
                  "value": 1.2336599,
                  "description": "score(freq=1.0), computed as boost * idf * tf from:",
                  "details": [
                    {
                      "value": 2.2,
                      "description": "boost",
                      "details": []
                    },
                    {
                      "value": 1.2039728,
                      "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                      "details": [
                        {
                          "value": 1,
                          "description": "n, number of documents containing term",
                          "details": []
                        },
                        {
                          "value": 4,
                          "description": "N, total number of documents with field",
                          "details": []
                        }
                      ]
                    },
                    {
                      "value": 0.46575344,
                      "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                      "details": [
                        {
                          "value": 1,
                          "description": "freq, occurrences of term within document",
                          "details": []
                        },
                        {
                          "value": 1.2,
                          "description": "k1, term saturation parameter",
                          "details": []
                        },
                        {
                          "value": 0.75,
                          "description": "b, length normalization parameter",
                          "details": []
                        },
                        {
                          "value": 4,
                          "description": "dl, length of field",
                          "details": []
                        },
                        {
                          "value": 4.25,
                          "description": "avgdl, average length of field",
                          "details": []
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      },
      {
        "_shard": "[test_score][0]",
        "_node": "EX7ZCQpSRLu-OWEZjQazog",
        "_index": "test_score",
        "_id": "1001",
        "_score": 0.7102385,
        "_source": {
          "title": "Hadoop is a FrameWork",
          "content": "Hadoop 是一个大数据基础框架"
        },
        "_explanation": {
          "value": 0.7102385,
          "description": "sum of:",
          "details": [
            {
              "value": 0.7102385,
              "description": "weight(title:hadoop in 1) [PerFieldSimilarity], result of:",
              "details": [
                {
                  "value": 0.7102385,
                  "description": "score(freq=1.0), computed as boost * idf * tf from:",
                  "details": [
                    {
                      "value": 2.2,
                      "description": "boost",
                      "details": []
                    },
                    {
                      "value": 0.6931472,
                      "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                      "details": [
                        {
                          "value": 2,
                          "description": "n, number of documents containing term",
                          "details": []
                        },
                        {
                          "value": 4,
                          "description": "N, total number of documents with field",
                          "details": []
                        }
                      ]
                    },
                    {
                      "value": 0.46575344,
                      "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                      "details": [
                        {
                          "value": 1,
                          "description": "freq, occurrences of term within document",
                          "details": []
                        },
                        {
                          "value": 1.2,
                          "description": "k1, term saturation parameter",
                          "details": []
                        },
                        {
                          "value": 0.75,
                          "description": "b, length normalization parameter",
                          "details": []
                        },
                        {
                          "value": 4,
                          "description": "dl, length of field",
                          "details": []
                        },
                        {
                          "value": 4.25,
                          "description": "avgdl, average length of field",
                          "details": []
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      }
    ]
  }
}
# 当boost指定为2时, 权重值翻倍

: 1,
“description”: “freq, occurrences of term within document”,
“details”: []
},
{
“value”: 1.2,
“description”: “k1, term saturation parameter”,
“details”: []
},
{
“value”: 0.75,
“description”: “b, length normalization parameter”,
“details”: []
},
{
“value”: 4,
“description”: “dl, length of field”,
“details”: []
},
{
“value”: 4.25,
“description”: “avgdl, average length of field”,
“details”: []
}
]
}
]
}
]
}
]
}
}
]
}
}

当boost指定为2时, 权重值翻倍

ElasticSearch8.x操作记录文章来源地址https://www.toymoban.com/news/detail-436256.html

到了这里,关于ElasticSearch8.x操作记录的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Elasticsearch8 - Docker安装Elasticsearch8.12.2

    最近在学习 ES,所以需要在服务器上装一个单节点的 ES 服务器环境:centos 7.9 目前最新版本是 8.12.2 新增配置文件 elasticsearch.yml 解释一下,前三行是开启远程访问和跨域,最后一行是开启密码访问 Networking | Elasticsearch Guide [8.12] | Elastic 在宿主机创建容器的挂载目录,我的目录

    2024年04月15日
    浏览(53)
  • Docker安装ElasticSearch8.X docker安装elasticsearch8.X完整详细教程

    Docker常用命令大全 Docker ElasticSearch 官方仓库 Docker 生产环境安装Elasticsearch教程 我这边选择的版本是 docker pull elasticsearch:8.8.1 在终端中执行以下命令以拉取 docker pull elasticsearch:8.8.1 根据自己使用过的版本: 使用以下命令创建一个新的 elasticsearch 容器并将其启动: --name 是 容器

    2024年02月15日
    浏览(45)
  • ElasticSearch8 - SpringBoot整合ElasticSearch

    springboot 整合 ES 有两种方案,ES 官方提供的 Elasticsearch Java API Client 和 spring 提供的 [Spring Data Elasticsearch](Spring Data Elasticsearch) 两种方案各有优劣 Spring:高度封装,用着舒服。缺点是更新不及时,有可能无法使用 ES 的新 API ES 官方:更新及时,灵活,缺点是太灵活了,基本是一

    2024年03月25日
    浏览(97)
  • ElasticSearch8闪退

    点了.bat文件好几次,发现最后每次都是最后出现了一堆报错信息后一下就没了。 去ES安装目录下的logs文件夹中找到执行日志。 查看出错原因 报错内容为 是按照网上文档设置该节点为主节点的设置有问题。 由于下载的版本为8,去查找了官方文档Elasticsearch Guide 在ES8中设置主

    2023年04月08日
    浏览(33)
  • 搭建Elasticsearch8.0集群

    PS:下面的机器名和后边要配置的集群节点名字没有任何关系,纯属巧合 ########################################### PS: ES8 自带 jdk ,所以不用配置 ########################################### 新建普通用户 ########################################### 下载、解压、修改属主属组为esuser(root) 新建数据和日志

    2024年02月03日
    浏览(47)
  • SpringBoot连接ElasticSearch8.*

    系统中需要使用到ElasticSearch进行内容检索,因此需要搭建SpringBoot + ElasticSearch的环境。

    2024年02月16日
    浏览(45)
  • springboot整合elasticsearch8

    1.引入maven依赖 2.application.yml添加配置 3.编写config文件 启动demo项目,通过控制台日志查看是否能够正常连接es。 4.在DemoApplicationTests编写简单测试操作es。

    2024年02月12日
    浏览(48)
  • ElasticSearch8.+ 通过https访问

    ElasticSearch8之后的版本默认是通过https访问的 也可以改为http访问,修改配置文件elasticsearch.yml 把下面配置改为false 重启就好了。

    2024年02月11日
    浏览(32)
  • ElasticSearch8集群的安装部署

    一、搭建集群的环境配置: 本集群使用Centos7.6操作系统,8G 4C 80G Linux 6版本不支持安装ES8版本 ES8版本以上的都自带JDK 二、集群安装规划如下: 机器地址 节点名称 节点角色 节点功能 10.1.80.94 node-1 Master,data 主+数据节点 10.1.80.95 node-2 Master,data 主+数据节点 10.1.80.96 node-3 Master,

    2023年04月09日
    浏览(54)
  • 【ES】elasticsearch8.3.3

    这里仅实践操作并根据实际问题进行记录笔记。 我们需要在自己的电脑上安装好 Docker Desktop。接着我们运行如下的命令:出现两个异常,一个是需要使用 winpty 因为我使用win的docker desktop,另外一个问题是docker启动elasticsearch ERROR: Elasticsearch did not exit normally - check the logs at xx

    2024年02月10日
    浏览(37)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包