I m new to Elasticsearch and before posting this question I have googled for help but not understanding how to write the query which i wanted to write.
My problem is I have few bunch of documents which i want to query, few of those documents has field "DueDate" and few of those has "PlannedCompletionDate" but not both exist in a single document. So I want to write a query which should conditionally query for a field from documents and return all documents.
For example below I m proving sample documents of each type and my query should return results from both the documents, I need to write query which should check for field existence and return the document
"_source": { ... "plannedCompleteDate": "2019-06-30T00:00:00.000Z", ... }
"_source": { ... "dueDate": "2019-07-26T07:00:00.000Z", ... }
plannedCompleteDateORdueDatefields, but not both these fields?