ElasticSearch query with AND and OR criteria Frequently when we will need to construct query to elasticsearch which bear AND and OR criteria similar to the following SQL statements: Statement 1: SELECT * FROM tblOrder WHERE orderDate=2015-01-01 14:00:00 AND customerID=29439; Statement 2: SELECT * FROM tblOrder WHERE orderDate=2015-01-01 14:00:00 OR customerID=29439; Statement 3: SELECT * FROM tblOrder WHERE orderDate <= 2015-01-01 14:00:00 AND customerID=29439; Statement 4: SELECT * FROM tblOrder WHERE (orderDate=2015-01-01 14:00:00 AND customerID=29439) OR customerID = 20991; Statement 5: SELECT * FROM tblOrder WHERE orderDate=2015-01-01 14:00:00 AND (customerID=29439 OR customerID = 20991); In ElasticSearch, we use "must" and "should" in place of AND and OR and "bool" in place of WHERE. Suppose in our ElasticSearch (at 179.168.0.1:9200), we have indexed documents having the following structures at index myOrder/myOrder: { "orderID" : xxxxx, ...