Elastic Search - kanuku/misc GitHub Wiki

Searching ALL

GET /release_management_db/_search
{
  "from" : 0, "size" : 20,
  "query": {
    "match_all": {}
  }
}

Query based on >= <= dates

GET /release_management/_search
{
  "from" : 0,
  "size" : 25,
  "timeout" : "10s",
  "query" : {
    "bool" : {
      "must" : [
        {
          "range" : {
            "iso_releasedate" : {
              "from" : "2018-02-17T00:00:00.000Z",
              "to" : null,
              "include_lower" : true,
              "include_upper" : true,
              "boost" : 1.0
            }
          }
        },
        {
          "range" : {
            "iso_expirydate" : {
              "from" : null,
              "to" : "2018-04-01T00:00:00.000Z",
              "include_lower" : true,
              "include_upper" : true,
              "boost" : 1.0
            }
          }
        }
      ],
      "adjust_pure_negative" : true,
      "boost" : 1.0
    }
  },
  "sort" : [
    {
      "deviceid" : {
        "order" : "asc"
      }
    }
  ]
}