美文网首页
es相关 Elasticsearch

es相关 Elasticsearch

作者: 无味wy | 来源:发表于2022-08-14 16:29 被阅读0次

数据迁移:复制新索引

POST _reindex
{
  "source": {
    "index": "old_index"
  },
  "dest": {
    "index": "new_index"
  }
}

创建索引 Mapping

PUT /new_index
{
  "mappings": {
    "properties": {
      "account_number": {
        "type": "long"
      },
      "address": {
        "type": "text"
      },
      "age": {
        "type": "integer"
      },
      "balance": {
        "type": "long"
      },
      "city": {
        "type": "keyword"
      },
      "email": {
        "type": "keyword"
      },
      "employer": {
        "type": "keyword"
      },
      "firstname": {
        "type": "text"
      },
      "gender": {
        "type": "keyword"
      },
      "lastname": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "state": {
        "type": "keyword"
      }
    }
  }
}

查询数据

GET /new_index/_search

查询Mapping

GET /index_name/_mapping

报错:Limit of total fields [1000] in index [xxx] has been exceeded

1.查询settings设置(未设置的情况下,默认结果里边应该没有limit选项)

GET xxxx/_settings

2.设置下字段上限

PUT xxxxx/_settings {
"index.mapping.total_fields.limit": 2000
}

相关文章

网友评论

      本文标题:es相关 Elasticsearch

      本文链接:https://www.haomeiwen.com/subject/rdqlgrtx.html