zoukankan      html  css  js  c++  java
  • elasticsearch nested 对象

    创建测试数据

    DELETE student
    # 创建 Nested 对象 Mapping
    PUT student
    {
          "mappings" : {
          "properties" : {
            "name" : {
              "type": "nested",
              "properties" : {
                "first_name" : {"type" : "keyword"},
                "last_name" : {"type" : "keyword"}
              }},
            "commet" : {
              "type" : "text",
              "fields" : {"keyword":{"type":"keyword","ignore_above":256}}
            }
          }
        }
    }
    POST student/_doc/1
    {
      "commet":"good",
      "name":[
        {
          "first_name":"wang ",
          "last_name":"er"
        },
    
        {
          "first_name":"zhang",
          "last_name":"san"
        }
    
      ]
    }
    View Code

     Nested 查询 ,hit 为0 ,表示正确

     # Nested Aggregation

      

    每天进步一点点,多思考,多总结 版权声明:本文为CNblog博主「zaituzhong」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
  • 相关阅读:
    页面定制CSS代码
    记录-20190511
    Java集合
    EL表达式
    javabean
    写一篇博文介绍JSP
    编写一篇博文介绍COOKIE和Session的原理及异同
    过滤器的使用
    Java种的String
    Java包装类
  • 原文地址:https://www.cnblogs.com/tingxin/p/15555745.html
Copyright © 2011-2022 走看看