44.mapping下的数据结构

主要知识点

1、了解es核心的数据类型

2、了解es默认的mapping方式

3、查看mapping

   

1、核心的数据类型

   

  • string,text
  • byte
  • shortintegerlongfloatdouble
  • boolean
  • date

       

2dynamic mapping

这是es自带的(默认的mapping方式),在程序员未指定的情况下默认以这种方式进行mapping,

   

true or false        -->        boolean

123                -->        long

123.45                -->        double

2017-01-01        -->        date

"hello world"        -->        string/text

   

3、查看mapping

语法:GET /index/_mapping/type

   

实例: GET /test_index/_mapping/test_type

结果如下

{

"test_index": {

"mappings": {

"test_type": {

"properties": {

"test_field": {

"type": "text",

"fields": {

"keyword": {

"type": "keyword",

"ignore_above": 256

}

}

},

"test_field1": {

"type": "text",

"fields": {

"keyword": {

"type": "keyword",

"ignore_above": 256

}

}

},

"test_field2": {

"type": "text",

"fields": {

"keyword": {

"type": "keyword",

"ignore_above": 256

}

}

}

}

}

}

}

}

posted @ 2018-02-25 17:43  outback123  阅读(276)  评论(0编辑  收藏  举报