Looking at what you're trying to do, I think what you want to do is use the bool query and then use a must clause there. I also think you really want the must clauses to be a term query rather than a terms query from what I see here.
© 2020. All Rights Reserved - Elasticsearch
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.