kibana操作ElasticSearch
程序员文章站
2022-07-06 10:46:43
...
目录
列出所有的index
get /_cat/indices?v
列出所有的映射
get /_mapping?pretty=true
查询type映射
GET index_name/type_name/_mapping
查询type中所有数据
GET index_name/type_name/_search
{
"query": {
"match_all": {}
}
}
指定每页条数
GET index_name/type_name/_search
{
"query": {
"match_all": {}
},
"from": 0,
"size": 1000
}
单条件等值查询
get index_name/type_name/_search
{
"query": {
"term": {
"bank_card_no":"641690698b00e73ed74e088115fee683225b274de87275dd"
}
}
}
单条件匹配查询
GET index_name/type_name/_search
{
"query":{
"match": {
"usr_no": "810133823347"
}
}
}
单条件分页查询
GET index_name/type_name/_search
{
"query": {
"match": {
"payer_usr_no": "110135489151"
}
},"size": 100
}
多条件匹配查询
GET /index_name/type_name/_search
{
"query": {
"bool": {
"must": [
{
"match": {
"base_handle_sys": "paybase"
}
},
{
"match": {
"payer_card_type": "Balance"
}
}
]
}
}
}
删除所有数据
POST index_name/type_name/_delete_by_query?conflicts=proceed
{
"query":{
"match_all":{}
}
}
删除index
DELETE /index_name
查询结果排序
GET index_name/type_name/_search
{
"query": {
"match": {
"usr_no":"110000104500"
}
},"sort": [
{
"reg_dt_tm": {
"order": "desc"
}
}
]
}
范围查询
GET /index_name/type_name/_search
{
"query": {
"range": {
"tm_smp":{
"gte":"20181218000000",
"lte":"20181230235959"
}
}
}
}
插入数据
POST index_name/type_name/810135262218
{
"usr_no": "810135262218",
"usr_prov": "四川省",
"usr_city": "广安市"
}
增加映射
PUT /index_name/_mapping/type_name
{
"properties": {
"reg_dt_tm": {
"type":"date",
"format":"yyyyMMddHHmmss"
},
"last_order_dt": {
"type":"date",
"format":"yyyyMMdd"
}
}
}
下一篇: shell 任务脚本