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"
    }

  • 相关阅读:
    python 版本 jaeger-client 导入失败 jaeger-client-python
    kubernetes ingress 重定向地址错误
    win10 多用户登录
    kubernetes监控prometheus配置项解读
    最新版 源码编译 docker
    alpine 容器优化
    kubernetes 中安装 heapster 问题
    github开源文章生成pdf
    jmeter分布式测试
    Cucumber(1)
  • 原文地址:https://www.cnblogs.com/qinjf/p/8525468.html
Copyright © 2011-2022 走看看