当前位置:网站首页>Kibana operation es
Kibana operation es
2022-07-25 14:34:00 【You are like a sweet Yida】
List of articles
es On
es website
kibana operation es
Elaticsearch, Referred to as es, Yes es The operation is based on REST Style operation ;
The basic operations are :PUT( establish , modify ) POST( establish , modify ) DELETE( Delete ) GET( Inquire about ) POST( Inquire about ) ; We usually do the most additions, deletions, modifications and checks ; Query is the most important and complex .
What I posted can be copied directly to kibana Inside , Then you can create more data by yourself , You can make your own according to the query .
Simple operation
# obtain ElasticSearch A lot of current information !
GET _cat/
GET /_cat/plugins
## participle
GET _analyze
{
"analyzer": "ik_smart",
"text": " Young people don't speak martial arts "
}
GET _analyze
{
"analyzer": "ik_max_word",
"text": " Young people don't speak martial arts "
}
# Create index , Cannot modify after creation
PUT /test1
{
"mappings": {
"properties": {
"name":{
"type": "text"
},
"age":{
"type": "long"
},
"birthday":{
"type": "date"
},
"tag":{
"type": "text"
}
}
}
}
# Get index information
GET test1
## Delete index
DELETE test1
# The new document Appoint id, Follow random id
PUT /test1/_doc/1
{
"name":" Zhang Yida ",
"age":11,
"birthday": "1990-08-09"
}
POST /test1/_doc/
{
"name":" Zhang Yida ",
"age":11,
"birthday": "1990-08-09"
}
# Modify the document
# put Cover ,_version Meeting +1 If not, it will be empty ( Don't suggest , Fields will be lost , Unless you really want to cover it all )
PUT /test1/_doc/1
{
"name" : " Zhang Yida ",
"age" : 183
}
GET /test1/_doc/1
# post _update Suggest ,_version unchanged ( Suggest , Be careful doc Field )
POST /test1/_update/1/
{
"doc": {
"name" : " Zhang Yida 2"
}
}
GET /test1/_doc/1
Query operation
Query basic operations
## Inquire about
## Deprecation: [types removal] Specifying types in search requests is deprecated. Will let you delete type,_doc
GET /test1/_doc/_search?q=name: benefit
GET /test1/_search?q=name: benefit
GET /test1/_search?q=age:11
## Query match
##match: matching ( Can use word segmentation to parse ( First analyze the document , And then query ))
## term: Specify terms directly through inverted index , Accurate query , No participle , Suitable field types are number,date,keyword, Not suitable for text
##_source: Filter fields
##sort: Sort
##form、size Pagination
GET /test1/_search
{
"query": {
"match": {
"name": " Zhang "
}
}
,
"_source": ["name","age"],
"sort": [
{
"age": {
"order": "asc"
}
}
],
"from": 1
,
"size": 1
}
# Multiconditional query
#must amount to and
#should amount to or
#must_not amount to not (... and ...)
#filter Filter
GET /test1/_search
{
"query": {
"bool": {
"must": [
{
"match": {
"name": "1"
}
},
{
"match": {
"age": "1"
}
}
],
"filter": [
{
"range": {
"age": {
"gte": 1,
"lte": 2
}
}
}
]
}
}
}
# Create an index with an array , If the index does not exist, it will be created automatically
POST /test_arr/_doc
{
"name" : " Zhang Yida 2",
"age" : 18,
"birthday":"1990-09-08",
"tag":[" The lawyer "," Funny "," self-confidence "]
}
POST /test_arr/_doc
{
"name" : " Zhang Yida 3",
"age" : 18,
"birthday":"1990-09-08",
"tag":[" The lawyer " ," male "]
}
GET /test_arr/_doc/1
GET /test_arr/_search
{
"query": {
"match": {
"tag": " male t "
}
}
}
# match Can use word segmentation to parse ( First analyze the document , And then query )
GET /test_arr/_search
{
"query": {
"bool": {
"must": [
{
"match": {
"name": " Zhang "
}
},
{
"match": {
"tag": " Male lawyers are funny, female confident people "
}
}
]
}
}
}
# term Accurate query
GET /test1/_search
{
"query": {
"term": {
"age": 1
}
}
}
text and keyword
- text:
Support participle , Full text search 、 Support ambiguity 、 Precise query , Aggregation is not supported , The sorting operation ;
text The maximum supported character length of type is unlimited , Suitable for large field storage ; - keyword:
No participle , Direct index 、 Support ambiguity 、 Support exact match , Support aggregation 、 The sorting operation .
keyword The maximum supported length of a type is ——32766 individual UTF-8 Type of characters , Can be set by ignore_above Specify self-contained character length , Data beyond a given length will not be indexed , Unable to get term Exact matching search results return .
## test keyword and text Whether word segmentation is supported
PUT /test
{
"mappings": {
"properties": {
"text":{
"type":"text"
},
"keyword":{
"type":"keyword"
}
}
}
}
PUT /test/_doc/1
{
"text":" test keyword and text Whether word segmentation is supported ",
"keyword":" test keyword and text Whether word segmentation is supported "
}
# text Support participle
# keyword Participle... Is not supported
# Find out
GET /test/_doc/_search
{
"query":{
"match":{
"text":" test "
}
}
}
## We can't find it
GET /test/_doc/_search
{
"query":{
"match":{
"keyword":" test "
}
}
}
# Word segmentation analysis
GET _analyze
{
"analyzer": "keyword",
"text": [" test liu"]
}
GET _analyze
{
"analyzer": "standard",
"text": [" test liu"]
}
GET _analyze
{
"analyzer":"ik_max_word",
"text": [" test liu"]
}
Highlight query
## Highlight query , The main thing is to add prefix and suffix to the content of the query
GET test1/_doc/_search
{
"query": {
"match": {
"name":" Zhang "
}
}
,
"highlight": {
"pre_tags": "<p class='key' style='color:red'>",
"post_tags": "</p>",
"fields": {
"name": {
}
}
}
}
thus kibana operation es Some common operations of , See the official documents for more details :
https://www.elastic.co/guide/cn/elasticsearch/guide/current/full-body-search.html
The next section uses java Code operation es
边栏推荐
- awk从入门到入土(24)提取指令网卡的ip
- 安防市场进入万亿时代,安防B2B网上商城平台精准对接深化企业发展路径
- QObject源码剖析-d指针和q指针
- Awk from entry to earth (24) extract the IP of the instruction network card
- Spark 参数配置的几种方法
- Opencv video tracking "suggestions collection"
- Gameframework making games (II) making UI interface
- SSH服务器拒绝了密码
- Numpy basic package for data analysis
- C language and SQL Server database technology
猜你喜欢
![优质数对的数目[位运算特点+抽象能力考察+分组快速统计]](/img/c9/8f8f0934111f7ae8f8abd656d92f12.png)
优质数对的数目[位运算特点+抽象能力考察+分组快速统计]

基于PaddleOCR开发uni-app离线身份证识别插件

Can the variable name be in Chinese? Directly fooled people

How to make a set of code fit all kinds of screens perfectly?

Filters get the data in data; Filters use data in data

Teach you how to apply for SSL certificate

English语法_不定代词 - other / another

D2. Chopping Carrots (Hard Version) (每日一题)

Realize a family security and environmental monitoring system (I)

PHP website design ideas
随机推荐
Detailed explanation of how R language converts large Excel files into DTA format
河源市区推出消防安全主题奶茶 助推夏季火灾防控
Keys and scan based on redis delete keys with TTL -1
Maya modeling exercise
Gateway reports an error service_ UNAVAILABLE
元器件采购系统的主要功能,数字化采购助力元器件企业飞速发展
Initial flask and simple application
应用实践:Paddle分类模型大集成者[PaddleHub、Finetune、prompt]
Huawei ENSP router static route (the next hop address of the default route)
English grammar_ Indefinite pronoun - other / other
Educational codeforces round 132 (rated for Div. 2) C, d+ac automata
H5页面input输入框弹起数字键盘,需要支持小数点
Gateway 网关报错 SERVICE_UNAVAILABLE
Niuke multi school E G J L
实现一个家庭安防与环境监测系统(二)
~5 new solution of CCF 2021-12-2 sequence query
Awk from entry to earth (24) extract the IP of the instruction network card
bond0脚本
结构体大小
BIO、NIO、AIO示例