chronotics / pithos-ext-es

Extension Pithos For ElasticSearch
GNU General Public License v3.0
0 stars 1 forks source link

[Sample] Query #2

Open hungph opened 5 years ago

hungph commented 5 years ago

Query by multi-conditions

GET thela-header-rf*/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "lot_cd": {
              "value": "TSMSH89007D0"
            }
          }
        },
        {
          "term": {
            "segment_id": {
              "value": "F1010"
            }
          }
        },
        {
          "range": {
            "time": {
              "gte": 1449428363000,
              "lte": 1649428363000
            }
          }
        }
      ]
    }
  }
}
hungph commented 5 years ago

DELETE by multi-conditions

POST thela-header-rf*/_delete_by_query?scroll_size=5000&wait_for_completion=true
{
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "lot_cd": {
              "value": "TSMSH89007D0"
            }
          }
        },
        {
          "term": {
            "segment_id": {
              "value": "F1010"
            }
          }
        },
        {
          "range": {
            "time": {
              "gte": 1449428363000,
              "lte": 1649428363000
            }
          }
        }
      ]
    }
  }
}

if wait_for_completion=false, check task is finished or not

GET _tasks?detailed=true&actions=*/delete/byquery