kibana简单用法

使用 Kibana 来搜索,查看存储在 Elasticsearch 索引中的数据并与之交互。

直接建索引表和表结构

PUT /month_index?pretty {
	"settings": {
		"number_of_shards": "5",
		"number_of_replicas": "1"
	},
	"mappings": {
		"wxMsg": {
			"properties": {
				"content": {
					"type": "text"
				},
				"createTime": {
					"type": "long"
				},
				"flag": {
					"type": "integer"
				},
				"imgPath": {
					"type": "keyword"
				},
				"transfer": {
					"type": "nested",
					"properties": {
						"payTpye": {
							"type": "integer"
						},
						"fee": {
							"type": "double"
						},
						"transId": {
							"type": "text"
						},
						"transferId": {
							"type": "text"
						},
						"invalidTime": {
							"type": "long"
						},
						"beginTime": {
							"type": "long"
						},
						"effectiveDate": {
							"type": "text"
						},
						"memo": {
							"type": "text"
						},
						"payMsgId": {
							"type": "text"
						}
					}
				}
			}
		}
	}
}

删除索引表

DELETE month_index

根据条件搜索并分页

GET month_index / wxMsg / _search {
	"from": 0,
	"size": 100,
	"query": {
		"match_phrase": {
			"flag": "419430449"
		}
	}
}

查询结果进行排序

GET month_index/wxMsg/_search
{
  "query": {
    "match_all": {}
  },
  "sort": {"createTime": {"order": "desc"}}
}

查看表结构

GET month_index/wxMsg/_mapping

查看字符串是怎么分词

GET /_analyze
{
  "analyzer": "standard",
  "text": "13866123123查看是怎样分词的哦呦"
}

修改现有表字段类型

PUT month_index/wxMsg/_mapping
{
  "properties":{
    "content" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        }
  }
}

查询全部数据

GET month_index/wxMsg/_search
{
  "query": {
    "match_all": {}
  }
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值