首页 > 其他分享 >Elasticsearch——》kibana操作索引:增删改查

Elasticsearch——》kibana操作索引:增删改查

时间:2023-04-13 16:44:26浏览次数:38  
标签:text 改查 ngram analyzer 索引 ik Elasticsearch kibana type

一、新建索引
PUT /test_001
{
"settings": {
"index": {
"max_result_window": 1000000
},
"analysis": {
"analyzer": {
"ik_max_word": {
"tokenizer": "ik_max_word",
"filter": [
"lowercase",
"asciifolding"
]
},
"comma": {
"type": "pattern",
"pattern": ","
},
"ngram": {
"tokenizer": "ngram",
"filter": [
"lowercase",
"asciifolding"
]
}
},
"tokenizer": {
"ngram": {
"type": "ngram",
"token_chars": [
"letter",
"digit",
"punctuation",
"symbol"
]
}
}
}
},
"mappings": {
"properties": {
"id": {
"type": "integer",
"fields": {
"keyword": {
"type": "text",
"analyzer": "ngram"
}
}
},
"goodsName": {
"type": "text",
"analyzer": "ik_max_word",
"fields": {
"keyword": {
"type": "text",
"analyzer": "ngram"
}
}
},
"shopId": {
"type": "integer"
},
"putSaleTime": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss"
},
"isDelete": {
"type": "boolean"
},
"couponIds": {
"type": "text",
"analyzer": "comma"
}
}
}
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78


1、指定分词器
standard:单字拆分
ik_smart:
ik_max_word:

POST _analyze
{
"analyzer": "standard",
"text":"没毛病"
}

POST _analyze
{
"analyzer": "ik_smart",
"text":"没毛病"
}

POST _analyze
{
"analyzer": "ik_max_word",
"text":"没毛病"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
二、修改索引
1、新增索引字段
PUT /test_001/_mapping
{
"properties": {
"actArea": {
"type": "double"
}
}
}
1
2
3
4
5
6
7
8


三、查看索引
1、查看所有索引(状态)
GET _cat/indices
1


2、查看所有索引(详细)
GET _all
1


3、查看指定索引
GET test_001
1


四、删除索引
DELETE test_001
1

————————————————
版权声明:本文为CSDN博主「小仙。」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_43453386/article/details/108670186

标签:text,改查,ngram,analyzer,索引,ik,Elasticsearch,kibana,type
From: https://www.cnblogs.com/gaoyanbing/p/17315352.html

相关文章

  • elasticsearch认证
    【转载https://www.cnblogs.com/gavinYang/p/11199699.html】elasticsearchshield(5.0以下版本权限认证)elasticsearch5.0以下的版本要用到权限控制的话需要使用shield。下载地址:https://www.elastic.co/downloads/shield5.0以上的版本则可以使用X-Pack,shield现在只是x-pac......
  • Elasticsearch之映射
    1.1 地理坐标点数据类型1.1.1地理坐标点地理坐标点是指地球表面可以用经纬度描述的一个点。地理坐标点可以用来计算两个坐标间的距离,还可以判断一个坐标是否在一个区域中。地理坐标点需要显式声明对应字段类型为geo_point:1.1.2经纬度坐标格式如上例,location字段被声......
  • Django 对实体的增删改查样例
    classUserInfo(models.Model):"""人员信息"""user_id=models.CharField(max_length=20,primary_key=True,blank=False,verbose_name='人员ID')user_name=models.CharField(max_length=200,blank=Fal......
  • Elasticsearch(ELK)集群环境部署
    目录一、概述二、准备1)机器环境准备2)创建elsearch用户三、elasticsearch部署1)下载并安装2)修改配置文件以支持集群四、启动出现的问题及解决方案1)JDK版本过低2)配置过低3)JVM内存大小指定太大,但本机内存不够用五、安装elasticsearch-head1)下载安装2)修改服务器监听地址六、安装Kiba......
  • mybatisPlus-增删改查
    引入依赖<?xmlversion="1.0"encoding="UTF-8"?><projectxmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.or......
  • Elasticsearch入门
    1、Elasticsearch的认识1.1Elasticsearch概述及其应用领域介绍当我们思考如何在海量数据中快速查找数据并获取准确结果时,Elasticsearch就起到了非常重要的作用。Elasticsearch是一种分布式的搜索引擎,可以用于全文检索、结构化检索和数据分析等领域。具体来说,它的应用领域包括......
  • sqlalchemy快速插入数据,scoped_session线程安全,加载类上的装饰器,基本增删改查,django中
    今日内容sqlalchemy快速插入数据sqlalchemy是什么orm框架,跟其他web框架没有必然联系,可以独立使用安装,快速使用,执行原生sql创建表和删除表不能创建数据库不能修改字段(增加,删除)使用orm插入第一步:生成engine对象engine=create_engine("mysql+pymysql://[email protected].......
  • flask框架06 sqlalchemy使用 scoped_session线程安全 一对多 多对多 增删改查
    今日内容详细目录今日内容详细1sqlalchemy快速插入数据2scoped_session线程安全2.1基本使用2.2加在类上的装饰器3基本增删查改3.1基本增删查改和高级查询3.2原生sql3.3django中执行原生sql4一对多4.1表模型4.2新增和基于对象的查询5多对多5.1表模型5.2增加和基于......
  • flask之sqlalchemy快速插入数据-scoped_session线程安全-基本增删改查-表模型一对多-
    目录flask之sqlalchemy快速插入数据-scoped_session线程安全-基本增删改查-表模型一对多-多对多-连表查询今日内容1sqlalchemy快速插入数据2scoped_session线程安全2.1基本使用2.2加在类上的装饰器3基本增删改查3.1基本增删改查和高级查询3.2原生sql3.3django中执行原生sq......
  • #yyds干货盘点 springboot和vue搭建前后端项目实现员工的增删改查
    前言我是歌谣今天继续带来前后端项目的开发上次已经开发了部门管理,今天继续开发员工管理后端第一步empcontroller代码packagecom.itheima.controller;importcom.itheima.pojo.Emp;importcom.itheima.pojo.PageBean;importcom.itheima.pojo.Result;importcom.itheima.s......