oracle 2.96 KB
GET policyproinfo/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "match_phrase": {
            "pp_prem_source": {
              "query": "1",
              "slop": 0,
              "boost": 1
            }
          }
        },
        {
          "match_phrase": {
            "pp_prem_status": {
              "query": "1",
              "slop": 0,
              "boost": 1
            }
          }
        },
        {
          "match_phrase": {
            "pp_prod_seq": {
              "query": "1",
              "slop": 0,
              "boost": 1
            }
          }
        },
        {
          "range": {
            "pp_prem_due_date": {
              "from": "2018-11-30T16:00:00.000Z",
              "to": "2019-01-01T16:00:00.000Z",
              "include_lower": true,
              "include_upper": true,
              "boost": 1
            }
          }
        },
        {
          "prefix": {
            "po_branch_code": {
              "value": "865100",
              "boost": 1
            }
          }
        }
      ],
      "must_not": [
        {
          "match": {
            "pp_product_code": {
              "query": "CBAN_TN1",
              "operator": "OR",
              "prefix_length": 0,
              "max_expansions": 50,
              "fuzzy_transpositions": true,
              "lenient": false,
              "zero_terms_query": "NONE",
              "auto_generate_synonyms_phrase_query": true,
              "boost": 1
            }
          }
        },
        {
          "match": {
            "pp_product_code": {
              "query": "CBAN_UN1",
              "operator": "OR",
              "prefix_length": 0,
              "max_expansions": 50,
              "fuzzy_transpositions": true,
              "lenient": false,
              "zero_terms_query": "NONE",
              "auto_generate_synonyms_phrase_query": true,
              "boost": 1
            }
          }
        },
        {
          "match": {
            "pp_product_code": {
              "query": "CBAN_VN1",
              "operator": "OR",
              "prefix_length": 0,
              "max_expansions": 50,
              "fuzzy_transpositions": true,
              "lenient": false,
              "zero_terms_query": "NONE",
              "auto_generate_synonyms_phrase_query": true,
              "boost": 1
            }
          }
        },
        {
          "terms": {
            "rnpsi_assign_rule": [
              "03"
            ],
            "boost": 1
          }
        },
        {
          "terms": {
            "po_channel_type": [
              "06",
              "08",
              "11"
            ],
            "boost": 1
          }
        }
      ],
      "adjust_pure_negative": true,
      "boost": 1
    }
  },
  "sort": [
    {
      "pp_prod_seq": {
        "order": "asc"
      }
    }
  ],
  "aggregations": {
    "distinct": {
      "cardinality": {
        "field": "po_policy_no"
      }
    }
  }
}