dnestoff
4/29/2020 - 10:22 PM

ElasticSearch

GET /_search
{
  "query": {                                  //1
    "bool": {                                 //2
      "must": [
       { "match":{"address":"Street"}}        //3
      ],
      "filter": [                             //4
        { "term":{"gender":"m"}},             //5
        { "range": { "age": { "gte": 25 }}}   //6
      ]
    }
  }
}
# Return all accounts from state UT.
GET /bank/_search?q=state:UT

# Return all accounts from UT or CA.
GET /bank/_search?q=state:UT OR CA

# Return all accounts from state TN and from female clients.
GET /bank/_search?q=state:TN AND gender:F

# Return all accounts from people older than 20 years.
GET /bank/_search?q=age:>20

# Return all accounts from people between 20 and 25 years old.
GET /bank/_search?q=age:(>=20 AND <=25)