在每个文档中查找数组类型字段的长度(大小) [英] Find length (size) of the array type field in each doc
本文介绍了在每个文档中查找数组类型字段的长度(大小)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的索引中有一个字段,它是一个整数数组.我要添加另一个包含元素数量计数的字段.
I have a field in my index which is an integer array. I want to add another field which contains the count of the number of elements.
即使提供计数的API调用也没问题.
Even an API call that gives the count is fine.
我发现了一些相关的东西:"script":"doc ['MyField'].values.size()"
I have found something relevant : "script" : "doc['MyField'].values.size()"
但是我不知道&在哪里使用它.请帮忙!
But I don't know how & where to use it. Please help!
推荐答案
您可以使用
这篇关于在每个文档中查找数组类型字段的长度(大小)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文