在 Mapping 里面,将 dynamic 参数设置成 strict 可以拒绝索引包含未知字段的文档。 此条 Tips 由 medcl 贡献。

es plainess脚本如何获取nested的值

Elasticsearch | 作者 CurryQin | 发布于2020年12月18日 | 阅读数:1134


企业微信截图_16082562856069.png

像这样两级嵌套,我想plainess脚本获取到date和price的值怎么获取。
以为我想进行price进行聚合,聚合出这些商品的价格区间
mapping结构:
"price": {
"type": "nested",
"properties": {
"sales_org_id": {
"type": "long"
},
"bundle_sub_product": {
"type": "boolean"
},
"date_price": {
"type": "nested",
"properties": {
"date": {
"type": "keyword"
},
"deal_id": {
"type": "long"
},
"discount_percentage": {
"type": "long"
},
"bundle_product_id": {
"type": "long"
},
"base_price": {
"type": "float"
},
"price": {
"type": "float"
},
"member_price": {
"type": "float"
},
"trade_in_price": {
"type": "float"
},
"max_order_quantity": {
"type": "long"
},
"min_order_quantity": {
"type": "long"
},
"product_feature": {
"type": "long"
},
"product_sold_count": {
"type": "long"
},
"special_info": {
"properties": {
"base_price": {
"type": "float"
},
"special_price": {
"type": "float"
},
"member_price": {
"type": "float"
},
"special_status": {
"type": "keyword"
},
"special_start_time": {
"type": "keyword"
},
"special_end_time": {
"type": "keyword"
}
}
}
}
}
}
}
}
已邀请:

ErkeZhou

赞同来自:

ErkeZhou

赞同来自:

CurryQin

赞同来自:

本人已解决谢谢

要回复问题请先登录注册