Querying a list to check the size

Initially, I wondered: are there multiple indices matched in the search, which might include older indices that do not have the correct mapping?

After doing more research, I noticed a few things that apply here:

  1. The documentation lists the ways to interact with nested documents, and it doesn't mention they can be interacted with in a script: https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html#nested-accessing-documents
  2. The documentation states that nested objects are stored as separate documents, but the script query works on single documents at a time
  3. I found another post with a similar question, and the responder stated:

    You can not access the values of all nested objects in a script at query time. Your script query only works on one nested object at a time.