问题

建立索引要 建立数据分片 否则 会出现  报错原因是 all shards failed 

PUT /student
{
  "mappings": {
    "properties": {
      "name":{
        "type": "text",
        "analyzer": "ik_smart"
      },
      "age":{
        "type": "keyword",
        "index": true
      }
    }
  },
  "settings": {
    "number_of_shards": 3,
    "number_of_replicas": 1
  }
}
number_of_shards 主分片 是3
number_of_replicas 副本是 1 , 主分片的 副本数量 是 3*1
index 要设置 为true

 

posted on 2025-04-02 10:56  是水饺不是水饺  阅读(3)  评论(0)    收藏  举报

导航