Field access in filter script


I have a mapping like this
"user": { "mappings": { "properties": { "profile": { "properties": { "cars": {...} }}}}}
I am trying to access the from a filter script with doc[""] and i get No field found for [] in mapping with types []

Cars is an array and i want to get the length.

I have no problem accessing it from a script_score with

Or maybe i'm doing it wrong. My objective is to filter out any documents that don't have a certain model of car in the array.

Using ES7.6.2

Thank you

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