频道栏目
首页 > 资讯 > 其他综合 > 正文

测试elasticsearch进行has_parent类型聚合

18-08-17        来源:[db:作者]  
收藏   我要投稿
GET my_test_index/_search
{
 "query": {
    "bool": {
      "must": [
        {
          "term": {
            "Type": "2" //子文档条件
          }
        },
        {
          "has_parent": {
            "parent_type": "parent_table", //父文档
            "query": {
              "match": {
                "number": "5203021066009201800035" //父文档条件
              }
            }
          }
        }
      ]
    }
  },
  "aggs":{
      "type_count":{
         "cardinality":{
            "field":"Type"
         }
      }
   }
}

执行上述聚合查询报一下错误
“type”: “illegal_argument_exception”,
“reason”: “Fielddata is disabled on text fields by default. Set fielddata=true on [Type] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.”

相关TAG标签
上一篇:常用五大数据类型详细介绍
下一篇:ODL之VTN详解-如何提供虚拟2层网络
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站