Trying to query on length of the nested field

It's actually the same question as posted at Getting No mapping Error right?

I answered there so let's keep the discussion in one single place. Thanks!