I'd compute that at index time instead of having to compute that at search time which is going to be slow as it has to go through all the hits. Specifically here that you have a match_all query.
You can do that with ingest and an ingest script processor on on your side (even better).
You should double check all docs actually have the srcPortMap field. It will only show as missing if the doc being evaluated does not have a value for the field.
But calculating this at index time will be much more efficient, as David suggested.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.