Is it possible to build query based on the condition in elastic search ?
E.g
{
"match": {
"ticket_group.marketplaceticket_source_id": (q.preferredProvider!=0) ? q.preferredProvider:""
}
}
In above coe if "q.preferredProvider
" is 0 then I want to omit condition for "ticket_group.marketplaceticket_source_id
" or you can say that "ticket_group.marketplaceticket_source_id
" can take any value otherwise "ticket_group.marketplaceticket_source_id
" should match with "q.preferredProvider
"
How can I write it in elastic search ?