ES查询语句

GET /_mapping

GET /core_abcalias_customer_basic_info_undetermined/_mapping

GET /core_abcalias_customer_basic_info/_search

GET /customer_basic_info/_s

GET /core_abcalias_customer_basic_info/_search
{
 "query": {
     "bool" : {
    "must" : [
      {
        "terms" : {
          "systemId": [
            "OGS"
          ],
          "boost" : 1.0
        }
      }
    ],
    "adjust_pure_negative" : true,
    "boost" : 1.0
  } 
 }
}

# 根据客户号查询es是否有该人员的相关信息
GET /core_abcalias_policy_role/_search
{
    "query": {
        "bool": {
            "must": [
                {
                    "terms": {
                        "customerId": [
                            "30d178c312992e736332ce580w"
                        ],
                        "boost": 1
                    }
                }
            ],
            "adjust_pure_negative": true,
            "boost": 1
        }
    }
}

# 根据保单号查询es是否有该人员的相关信息
GET /core_abcalias_customer_basic_info/_search
{
    "from": 0,
    "size": 100,
    "query": {
        "bool": {
            "must": [
                {
                    "terms": {
                        "businessNo": [
                            "00671071370122290000000059"
                        ],
                        "boost": 1
                    }
                }
            ],
            "adjust_pure_negative": true,
            "boost": 1
        }
    },
    "sort": [
        {
            "businessTime": {
                "order": "desc"
            }
        }
    ]
}


# 根据证件号等基本信息查询abc保存信息
GET /core_abcalias_customer_basic_info/_search
{
    "from": 0,
    "size": 100,
    "query": {
        "bool": {
            "must": [
                {
                    "term": {
                        "identifyNumber": {
                            "value": "2C8I0D650f869cd43ab0139d4a936a806b9be8a96da6c34e7310cc897822467b376235cf",
                            "boost": 1
                        }
                    }
                },
                {
                    "term": {
                        "name": {
                            "value": "吴梦",
                            "boost": 1
                        }
                    }
                }
            ],
            "adjust_pure_negative": true,
            "boost": 1
        }
    },
    "sort": [
        {
            "businessTime": {
                "order": "desc"
            }
        }
    ]
}

GET /core_abcalias_customer_basic_info/_search
{
    "from": 0,
    "size": 100,
    "query": {
        "bool": {
            "must": [
                {
                    "term": {
                        "identifyNumber": {
                            "value": "2C8I0D6531e016999c1cdd82e076453bf8754331c6dac5cb776316c34be21d17ae958fbd",
                            "boost": 1
                        }
                    }
                },
                {
                    "term": {
                        "name": {
                            "value": "老小",
                            "boost": 1
                        }
                    }
                },
                {
                    "terms": {
                        "businessNo": [
                            "8H2105DA1C85258"
                        ],
                        "boost": 1
                    }
                }
            ],
            "adjust_pure_negative": true,
            "boost": 1
        }
    },
    "sort": [
        {
            "businessTime": {
                "order": "desc"
            }
        }
    ]
}


GET /core_abcalias_policy_role/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "terms": {
            "customerId": [
              "308fdfa92cf84ca885442a200p"
            ],
            "boost": 1
          }
        },
        {
          "terms": {
            "policyNo": [
              "T211223000000120101326"
            ],
            "boost": 1
          }
        },
        {
          "terms": {
            "policyRole": [
              "2",
              "4",
              "5",
              "7"
            ],
            "boost": 1
          }
        }
      ],
      "adjust_pure_negative": true,
      "boost": 1
    }
  }
}


GET /core_abcalias_policy_role/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "terms": {
            "customerId": [
              "30d06841e706e000419200f00x"
            ],
            "boost": 1
          }
        },
        {
          "terms": {
            "policyRole": [
              "2"
            ],
            "boost": 1
          }
        }
      ],
      "adjust_pure_negative": true,
      "boost": 1
    }
  }
}

POST _sql?format=json
  { "query":"select customerId,businessNo from core_abcalias_customer_basic_info where  businessType in ('P','E','C')"}

GET /core_abcalias_customer_basic_info/_search
{
  "query": {
"bool" : {
"must" : [

      {
"term" : {
"name": {
"value" : "一职级四变更",
"boost" : 1.0
          }
        }
      },
   
            {
"term" : {
"systemId": {
"value" : "OGS",
"boost" : 1.0
          }
        }
      }

    ],
"adjust_pure_negative" : true,
"boost" : 1.0
  }
}
}

GET _nodes/thread_pool/

GET /_nodes/hot_threads


GET /core_abcalias_customer_basic_info/_search/?scroll=2m
{
  "query": {
    "match_all": {}
  }, 
  "size": 100

}

GET /core_abcalias_customer_basic_info/_count
{
  "query": {
      "range": {
            "flowTime": {
                "gte": 1622476800000,
                "lte": 1623686400000
            }
        }   
  }
}

GET /core_abcalias_org_customer_info/_count
{
  "query": {
      "range": {
            "flowTime": {
                "gte": 1622476800000,
                "lte": 1623686400000
            }
        }   
  }
}

GET /core_abcalias_org_customer_info/_search
{
"query": {
"term": {
"systemId": {
"value": "OGS"
      }

    }

  },"sort": [
    {
"flowTime": {
"order": "desc"
      }
    }
  ]

}


GET */_alias/*

GET _cat/shards


GET /core_abcalias_customer_basic_info/_search
{
  "query": {
   "match_all": {}
  },"sort": [
    {
      "flowTime": {
        "order": "desc"
      }
    }
  ]
}

DELETE /core_abc_customer_basic_info-000006/_doc/B3730627175959839631600101920200000000192425891


POST _aliases
{
  "actions": [
    {
      "add": {
        "index": "test-000001",
        "alias": "alias_test"
      }
    }
  ]
}

GET /_alias

GET /_mapping

PUT test-000001 
{
  "settings": {
    "number_of_replicas": 1,
    "number_of_shards": 1
  }, 
  "mappings": {
      "properties": {
         "accountList" : {
          "properties" : {
            "accountName" : {
              "type" : "keyword"
            },
            "accountNo" : {
              "type" : "keyword"
            },
            "bankAccountType" : {
              "type" : "keyword"
            },
            "bankBranchName" : {
              "type" : "keyword"
            },
            "bankPayType" : {
              "type" : "keyword"
            },
            "businessNo" : {
              "type" : "keyword"
            },
            "businessTime" : {
              "type" : "date"
            },
            "businessType" : {
              "type" : "keyword"
            },
            "flowTime" : {
              "type" : "date"
            },
            "fromId" : {
              "type" : "keyword"
            },
            "payDate" : {
              "type" : "date"
            },
            "paySumFee" : {
              "type" : "double"
            },
            "payeeBankCity" : {
              "type" : "keyword"
            },
            "payeeBankCode" : {
              "type" : "keyword"
            },
            "payeeBankName" : {
              "type" : "keyword"
            },
            "payeeBankProvince" : {
              "type" : "keyword"
            },
            "payeeComCode" : {
              "type" : "keyword"
            },
            "paymentDate" : {
              "type" : "date"
            },
            "paymentMode" : {
              "type" : "keyword"
            },
            "paymentType" : {
              "type" : "keyword"
            },
            "sumPaid" : {
              "type" : "double"
            },
            "systemId" : {
              "type" : "keyword"
            },
            "transid" : {
              "type" : "keyword"
            },
            "updateTime" : {
              "type" : "date"
            }
          }
        }
      }      
    
  
  }

}

PUT test-000002 
{
  "mappings": {
    "properties": {
      "test" :{
        "type": "keyword"
      }
    }
  }
}

GET _search
{
  "query": {
    "match_all": {}
  }
}

GET _all/_settings?allow_no_indices

GET /core_abcalias_customer_basic_info/

GET /core_abcalias_customer_basic_info/_search
{
  "bool" : {
    "must" : [
      {
        "term" : {
          "businessNo" : {
            "value" : "E2021011500060",
            "boost" : 1.0
          }
        }
      },
      {
        "term" : {
          "businessType" : {
            "value" : "E",
            "boost" : 1.0
          }
        }
      },
      {
        "term" : {
          "systemId" : {
            "value" : "NEWOTP",
            "boost" : 1.0
          }
        }
      },
      {
        "exists" : {
          "field" : "ctmNo",
          "boost" : 1.0
        }
      }
    ],
    "adjust_pure_negative" : true,
    "boost" : 1.0
  }
}

GET /core_abcalias_customer_basic_info/_search
{
  "query": {
    "term": {
      "identifyNumber": {
        "value": "海飞丝"
      }
    }
  }
}


GET /core_abcalias_customer_basic_info/_search
{
  "query": {
    "term": {
      "identifyNumber": {
        "value": "2C8I0D654440742a56edd53e14d3e2d717b3352c301bf9fae141a7761cb1c4efbb4c4e8a"
      }
    }
  },"sort": [
    {
      "flowTime": {
        "order": "desc"
      }
    }
  ]
}


GET /core_abcalias_customer_basic_info/_search
{
    "size": 1000,
    "query": {
        "bool": {
            "must": [
                {
                    "term": {
                        "businessNo": {
                            "value": "E2021011500060",
                            "boost": 1
                        }
                    }
                },
                {
                    "term": {
                        "businessType": {
                            "value": "E",
                            "boost": 1
                        }
                    }
                },
                {
                    "term": {
                        "systemId": {
                            "value": "NEWOTP",
                            "boost": 1
                        }
                    }
                },
                {
                    "exists": {
                        "field": "ctmNo",
                        "boost": 1
                    }
                }
            ],
            "adjust_pure_negative": true,
            "boost": 1
        }
    }
}


GET /core_abcalias_customer_basic_info/_search
{
  "query": {
    "term": {
      "name": {
        "value": "段志岗"
      }
    }
  }
}

GET /core_abcalias_summary_customer/_search?scroll=1m
{
    "query": {
        "bool": {
            "must": [
                {
                    "term": {
                        "identifyType": {
                            "boost": 1.0,
                            "value": "01"
                        }
                    }
                },
                  {
                    "term": {
                        "name": {
                            "value": "杨幂"
                        }
                    }
                }
                
            ]
        }
    },
    "sort": [
      {
        "updateTime": {
          "order": "desc"
        }
      }
    ]
}


GET /core_abcalias_customer_basic_info_undetermined/_search
{
  "query": {
    "term": {
      "name": {
        "value": "张等等"
      }
    }
  }
}


GET /core_abcalias_customer_basic_info/_mapping

GET /core_abcalias_customer_basic_info/_search
{
  "query": {
    "match": {
      "businessNo": "2021011100008"
    }
  },
  "sort": [
    {
      "flowTime": {
        "order": "desc"
      }
    }
  ]
}

GET /core_abcalias_policy_role/_search
{
    "query": {
        "bool": {
            "must": [
                {
                    "terms": {
                        "customerId": [
                            "30d030c4e77660004103081808",
                            "309030c9452840004f807c0008"
                        ],
                        "boost": 1
                    }
                },
                {
                    "terms": {
                        "policyNo": [
                            "H201230000003760152157"
                        ],
                        "boost": 1
                    }
                },
                {
                    "terms": {
                        "policyRole": [
                            "2",
                            "4",
                            "5",
                            "7"
                        ],
                        "boost": 1
                    }
                }
            ],
            "adjust_pure_negative": true,
            "boost": 1
        }
    }
}


GET /core_abcalias_policy_role/_search
{"query":{"bool":{"must":[{"terms":{"customerId":["30d06841e706e000419200f00x"],"boost":1.0}},{"terms":{"policyRole":["2"],"boost":1.0}}],"adjust_pure_negative":true,"boost":1.0}}}

GET /core_abcalias_org_customer_info/_mapping


GET /core_abcalias_customer_basic_info/_search
{
    "query": {
        "bool": {
            "must": [
                {
                    "terms": {
                        "customerId": [
                            "309030c9452840004f807c0008"
                        ],
                        "boost": 1
                    }
                },
                {
                    "terms": {
                        "policyRole": [
                            "2",
                            "4",
                            "5",
                            "7"
                        ],
                        "boost": 1
                    }
                }
            ],
            "adjust_pure_negative": true,
            "boost": 1
        }
    }
}

GET /core_abcalias_customer_basic_info/_search
{
    "from": 0,
    "size": 100,
    "query": {
        "bool": {
            "must": [
                {
                    "terms": {
                        "businessNo": [
                            "H201230000003760152157"
                        ],
                        "boost": 1
                    }
                }
            ],
            "adjust_pure_negative": true,
            "boost": 1
        }
    },
    "sort": [
        {
            "businessTime": {
                "order": "desc"
            }
        }
    ]
}

# 2C8I0D65d07e40098bbb919bf5daae746dcef90a8c0468e7bf304756d3967d452aae02d9


GET /core_abcalias_customer_basic_info/_search
{
  "query": {
    "term": {
      "businessNo": {
        "value": "EF7A34F8F5B69EABA338C4FB9115E5FC"
      }
    }
  },"sort": [
    {
      "flowTime": {
        "order": "desc"
      }
    }
  ]
}

GET /core_abcalias_customer_basic_info/_search
{
  "query": {
    "term": {
      "customerId": {
        "value": "114cead5ae589a0a9m1950010q"
      }
    }
  },"sort": [
    {
      "flowTime": {
        "order": "desc"
      }
    }
  ]
}


GET /core_abcalias_summary_customer/_search
{
  "query": {
    "term": {
      "identifyNumber": {
        "value": "2C8I0D65740fea1f13905e2476a5c15bb997f3cae1ccaaf5fa082e6eea2b1d6c4f8fc366"
      }
    }
  }
}

GET /core_abcalias_org_customer_info/

GET /core_abcalias_org_customer_info/_search
{
  "query": {
    "term": {
      "iden": {
        "value": "0130110121920200000000"
      }
    }
  }
}

GET /core_abcalias_customer_basic_info/_search
{
  "query": {
    "term": {
      "name": {
        "value": "吉他唱"
      }
    }
  }
}


GET /core_abcalias_org_customer_info/_search
{
  "query": {
    "term": {
      "": {
        "value": "2C8I0D65561db5ab428b5cce6737508b2b5784f8"
      }
    }
  }
}

GET /core_abcalias_customer_basic_info/_search
{
  "query": {
    "term": {
      "name": {
        "value": "王语嫣"
      }
    }
  },
  "sort": [
    {
      "flowTime": {
        "order": "desc"
      }
    }
  ]
}

 POST _sql?format=json
    {
      "query":"select * from core_abcalias_customer_basic_info where customerId like 'I%'"
    }

GET /core_abcalias_customer_basic_info_undetermined/_search
{
    "query": {
    "term": {
      "identifyNumber": {
        "value": "2C8I0D65f4745437e7bbe730fa4531f42b0491b53ad95dc6f516d0611e3c7663c2e2a45f"
      }
    }
  },
  "sort": [
    {
      "businessTime": {
        "order": "desc"
      }
    }
  ]
}


GET /core_abcalias_summary_customer/_search
{
  "query": {
    "term": {
      "customerId": {
        "value": "30c82ca6adcfec41c6e00ff008"
      }
    }
  }
}

GET /core_abcalias_customer_basic_info_undetermined/_search
{
  "query": {
    "match_all": {}
  }
}


GET /core_abcalias_summary_customer/_count
{
  "query": {
    "bool": {
      
      "must": [
        {
          "range": {
            "createTime": {
              "gte": 1608048000000,
              "lte": 1608134400000
            }
          },
          "term": {
            "identifyType": {
              "value": "01"
            }
          }
          
        }
      ]
    }
  }
}

GET /core_abcalias_summary_customer/_count
{
  "query": {
    "bool" : {
    "must" : [
      {
        "range" : {
          "createTime": {
            "from" : 1608048000000,
            "to" : 1608134400000,
            "include_lower" : true,
            "include_upper" : true,
            "boost" : 1.0
          }
        }
      },
      {
        "term" : {
          "identifyType" : {
            "value" : "01",
            "boost" : 1.0
          }
        }
      }
    ],
    "adjust_pure_negative" : true,
    "boost" : 1.0
  }
  }
}


GET /core_abcalias_customer_basic_info/_search
{
  "bool" : {
    "must" : [
      {
        "terms" : {
          "businessNo" : [
            "600000513092021940110262095621"
          ],
          "boost" : 1.0
        }
      }
    ],
    "adjust_pure_negative" : true,
    "boost" : 1.0
  }
}

PUT /core_abcalias_customer_basic_info/_mapping
{"properties":{
    "abcId":{
     "type":"keyword"
  }
}}


GET /core_abcalias_customer_basic_info/_search
{
  "query": {
    "term": {
      "businessNo": {
        "value": "600000513092021940110262095621"
      }
    }
  }
}


GET core_abcalias_customer_basic_info/_alias

GET /core_abcalias_customer_basic_info/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "businessNo": "601011007202012039782296877"
          }
        },
        {
          "match": {
            "ctmNo": "333"
          }  
        },{
          "match": {
            "systemId": "CAS"
          }
        },{
          "match": {
            "businessType": "02"
          }
        }
      ]
    }
  }
}
  


GET /core_abc_customer_basic_info-*/_count

GET /core_abcalias_customer_basic_info/_count


GET /_cat/aliases?v

GET /core_abcalias_customer_basic_info/
{
  "query":{"bool":{"must":
  [{"term":{"businessNo":{"value":"600000031101201710000092784","boost":1.0}}},
  {"term":{"businessType":{"value":"1","boost":1.0}}},
  {"term":{"systemId":{"value":"CAS","boost":1.0}}}
  ,{"exists":{"field":"ctmNo","boost":1.0}}]
    
  }}
}


GET /core_abcalias_summary_customer/_search
{
  "query": {
    "match_all": {}
  }
}


GET /core_abcalias_summary_customer/_search
{
  "query":{
    "bool": {
      "must": [
        {
          "term": {
            "identifyType": {
              "value": "01"
            }
          }
          
        }
      ],
      "should": [
        {
          "term": {
            "identifyNumber": {
              "value": "2C8I0D659d77ffc5cd6bf722d95e4e55afbe7d9cb5959fc70ffd5aaafc8c74e07c440e86"
            }
          }
        },
        {
          "term": {
            "name": {
              "value": "张三"
            }
          }
        }
      ]
    }
  }
}


GET /core_abcalias_customer_basic_info/_search
{
  "query": {
    "term": {
      "customerId": {
        "value": "30d15a0508a1ee736fa496c008"
      }
    }
  }
}


GET /core_abcalias_org_customer_info/_search
{
  "query": {
    "term": {
      "businessNo": {
        "value": "600000513092021940110262095621"
      }
    }
  },"sort": [
    {
      "businessTime": {
        "order": "desc"
      }
    }
  ]
}


GET /core_abcalias_customer_basic_info/_search
{
  "query": {
    "match_all": {}
  }
}

GET _alias


GET /core_abcalias_customer_basic_info_/_search
{
  "query": {
    "match_all": {}
  }
}


GET /core_abcalias_customer_basic_info/_search
{
  "query": {
    "term": {
      "identifyNumber": {
        "value": "2C8I0D658396b94865b1e720e4868da3750885b012271cd8de6e7f1678b1cd34b32304d3"
      }
    }
  },
  "sort": [
    {
      "flowTime": {
        "order": "desc"
      }
    }
  ]
}


GET _cat/aliases

GET /core_abcalias_customer_basic_info/_search
{
  "query": {
    "term": {
      "identifyNumber": {
        "value": "2C8I0D65095a257194f12519e50bb8e12c916c81"
      }
    }
  },
  "sort": [
    {
      "flowTime": {
        "order": "desc"
      }
    }
  ]
}


GET /core_abcalias_customer_basic_info/_count
{
  "query": {
    "bool": {
      "must": [
        {
          "exists": {
            "field": "name"
          }
        },
        {
          "exists": {
            "field": ""
          }
        }
      ]
    }
  }
}

GET /core_abc_org_customer_info/_search
{
  "query": {
    "term": {
      "organizationName": {
        "value": "宝岛眼镜"
      }
    }
  }
}


GET /core_abcalias_customer_basic_info_undetermined/_search
{
  "query": {
    "term": {
      "businessNo": {
        "value": "C01441427199303214918"
      }
    }
  }
}


GET /core_abcalias_customer_basic_info/_count
{
  "query": {
    "bool": {
      "must": [
        {
          "exists": {
            "field": "name"
          }
        }
      ]
    }
  }
}

GET /core_abcalias_policy_role/_search


GET /core_abcalias_org_customer_info/_search
{
  "query": {
    "match_all": {}
  }
}

GET /core_abcalias_summary_customer/_search
{
  "query": {
   "term": {
     "occupationCode": {
       "value": "001"
     }
   }
  }
}

GET core_abcalias_org_id_relation/_search
{
  "query": {
    "match_all": {}
  }
}


GET core_abcalias_customer_basic_info_undetermined/_search
{
  "query": {
    "match_all": {}
  },
  "sort": [
    {
      "flowTime": {
        "order": "desc"
      }
    }
  ]
}

GET /core_abcalias_org_customer_info/_search
{
  "query": {
      "term": {
        "organizationName": {
          "value": "华新科技有限公司"
        }
      }
    }
  
}

GET /core_abcalias_customer_basic_info/_search
{
  "query": {
   "term": {
      "businessNo": {
        "value": "8A20001T000003L"
      }
    }
  }
}


GET /core_abcalias_customer_basic_info_undetermined/_search
{
  "query": {
   "term": {
      "identifyNumber": {
        "value": "2C8I0D65cbb2e80db76db2eb1539a72b3a546f05b925f8dc9a4094e731d03cf3ad39b404"
      }
    }
  }
}

GET /core_abcalias_customer_basic_info/_search
{
  "query": {
   "term": {
      "name": {
        "value": "彭有二"
      }
    }
  }
}

GET core_abcalias_claim_summary/_count

GET /core_abcalias_customer_basic_info/_search
{
  "query": {
    "term": {
      "identifyNumber": {
        "value": "2C8I0D65cbb2e80db76db2eb1539a72b3a546f05b925f8dc9a4094e731d03cf3ad39b404"
      }
      
    }
  }
}


GET /core_abcalias_org_customer_info/_search
{
  "query": {
   "match_all": {}
  }
}


GET core_abcalias_customer_basic_info/_search
{
  "query": {
    "match": {
      "address": "TEST_北京昌平*"
    }
  }
}

GET core_abcalias_customer_basic_info/_search
{
  "query": {
    "match_phrase": {
      "addInfoList.address": "TEST_北京昌平*"
    }
  }
}
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Elasticsearch是一个开源的分布式搜索和分析引擎,它提供了丰富的查询语句来进行数据检索和分析。下面是一些常用的Elasticsearch查询语句的介绍: 1. Match查询:用于执行全文搜索,它会将查询字符串与指定字段进行匹配。例如: ``` GET /index/_search { "query": { "match": { "field": "query_string" } } } ``` 2. Term查询:用于精确匹配某个字段的值。例如: ``` GET /index/_search { "query": { "term": { "field": "value" } } } ``` 3. Range查询:用于匹配指定范围内的值。例如: ``` GET /index/_search { "query": { "range": { "field": { "gte": "start_value", "lte": "end_value" } } } } ``` 4. Bool查询:用于组合多个查询条件,支持must、must_not、should等逻辑操作符。例如: ``` GET /index/_search { "query": { "bool": { "must": [ { "match": { "field1": "value1" } }, { "match": { "field2": "value2" } } ], "must_not": [ { "term": { "field3": "value3" } } ], "should": [ { "term": { "field4": "value4" } } ] } } } ``` 5. Aggregation聚合查询:用于对数据进行分组和统计分析。例如: ``` GET /index/_search { "aggs": { "group_by_field": { "terms": { "field": "field" }, "aggs": { "stats": { "stats": { "field": "numeric_field" } } } } } } ``` 这些只是Elasticsearch查询语句的一小部分,Elasticsearch还提供了更多的查询语句和功能,如模糊查询、通配符查询、正则表达式查询、地理位置查询等。你可以根据具体的需求选择合适的查询语句来进行数据检索和分析。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值