Data can be something like which has both events and promotions, just events or just promotions.
Requirement is like If i am only searching for events, I should match documents just having events as an array. Currently it is returning if events are matched but promotions are also present.
From what I understand you only want doc with items in the events array, the promotions array must be empty.
In this case I would try to combine a must events equals xpto and an exists query in the promotions field inside a must_not. So the return would only be docs with events. Maybe this works on the data you cited so far.
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.