Elastic Search Query on Two Documents

@Vinayak_Sapre the above question link to Elastic Search Aggregation and Complex Query can you please check here for criteria.and help me there.
also, you can see https://stackoverflow.com/questions/62574006/elastic-search-aggregation-and-complex-query for more reference.