关于elasticsearch:elasticsearch-的常见错误

3次阅读

共计 268 个字符,预计需要花费 1 分钟才能阅读完成。

一、参考

二、命名标准

2.1 索引名称必须是小写

2.2 字段名称不能蕴含点号.

(1)创立索引

PUT testfieldname/
{
  "mappings": {
    "properties": {
      "f1.f2": {"type": "keyword"}
    }
  }
}

(2) 查看mapping

GET testfieldname/_mapping

{
  "testfieldname" : {
    "mappings" : {
      "properties" : {
        "f1" : {
          "properties" : {
            "f2" : {"type" : "keyword"}
          }
        }
      }
    }
  }
}

字段名称中蕴含有 ., 会主动解析为json 构造

正文完
 0