ES: adding ability to pass a query to the script to further filter the set of documents analyzed