首页 > 数据库技术 > 详细

ES数据库创建索引

时间:2021-06-25 12:32:19      阅读:8      评论:0      收藏:0      [点我收藏+]

1. 进入Dev Tools

2. 将下列内容粘贴过去,(对内容进行修改‘id’对应位置就是字段)

PUT /kpwiki
{
  "settings": {
    "number_of_shards": "2",
    "number_of_replicas": "1"
  },
  "mappings": {
    "properties": {
        "id": {
          "type": "long"
        },
        "app_id": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "name": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "source_url": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "status": {
          "type": "long"
        },
        "create_time": {
          "type": "date"
        },
        "update_time": {
          "type": "date"
        },
        "content": {
          "type": "text",
          "analyzer": "ik_smart",
          "search_analyzer": "ik_smart"
        },
        "rich_content": {
          "type": "text",
          "analyzer": "ik_smart",
          "search_analyzer": "ik_smart"
        }
      }
    }
}

 

ES数据库创建索引

原文:https://www.cnblogs.com/niulang/p/14929829.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!