zoukankan      html  css  js  c++  java
  • 手动建立mapping以及增加属性

    只能创建index时手动建立mapping,或者新增field mapping,但是不能update field mapping

    1、手动建立mapping
    PUT /website
    {
      "mappings": {
        "article": {
          "properties": {
            "author_id": {
              "type": "long"
            },
            "title": {
              "type": "text",
              "analyzer": "english"
            },
            "content": {
              "type": "text"
            },
            "post_date": {
              "type": "date"
            },
            "publisher_id": {
              "type": "text",
              "index": "not_analyzed"
            }
          }
        }
      }
    }

    2、增加mapping属性
    PUT /website/_mapping/article
    {
      "properties" : {
        "new_field" : {
          "type" : "string",
          "index": "not_analyzed"
        }
      }
    }

    3、测试mapping
    GET /website/_analyze
    {
      "field": "content",
      "text": "my-dogs"
    }

  • 相关阅读:
    学习加密(四)spring boot 使用RSA+AES混合加密,前后端传递参数加解密
    vue实现rsa加密,数字签名,md5加密等
    Thymeleaf 基本用法总结
    空格去
    SpringBoot+Shiro学习(七):Filter过滤器管理
    vue-lazyload的使用
    vue中使用base64和md5
    vuex使用一
    webpack使用七
    webpack使用六
  • 原文地址:https://www.cnblogs.com/qinjf/p/8525468.html
Copyright © 2011-2022 走看看