Fetch results where count of nested field is more than 1

So I have a mapping where "configs" is a nested field.

  "type": "nested",
  ["properties"]: {[56 items]

Now I want to fetch docs where 'configs' have more than 1 objects.
For this I am using

  "script": {
    "script": {
     "source": "doc['configs'].length > 1",
       "lang": "painless"

I have also tried .size() and .values.size()
But it always gives error
No field found for [configs] in mapping with types [inventory]

Can anyone provide any help here?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.