@TOC
PUT _template/test-logs
{
"index_patterns": "test-logs-*",
"settings": {
"number_of_shards": 5,
"number_of_replicas": 1,
"analysis": {
"analyzer": {
"my_analyzer": {
"type": "pattern",
"pattern":["_","-"]
}
}
}
},
"aliases": {
"test-logs-read": {}
},
"mappings": {
"_doc":{
"properties": {
"file_name": {
"type": "text"
},
"table": {
"type": "text",
"analyzer": "my_analyzer"
},
"size": {
"type": "text",
"index": false
}
}
}
}
}
HEAD _template/test-logs
POST my_index1/_analyze
{
"analyzer": "my_analyzer",
"text": "103_addserialnumber-1"
}
GET _analyze
{
"analyzer": "ik_smart",
"text": "五常大米"
}
GET /test-logs-100000
POST /test-logs-write/_doc
{
"name":"mao",
"sex" :"Male"
}
GET /test-logs-read/_search
{
"query": {
"match_all": {}
},
"from":0,
"size": 10
}
GET _cat/templates/
DELETE /test-logs-write
GET _template/test-logs
GET 12_assets_directory_v1/_doc/_search
{
"query": {
"multi_match":{
"query": "月份",
"fields": ["file_name","database_name","table_name"]
}
},
"highlight": {
"fields": {
"file_name":{
"pre_tags": "<font color=red>",
"post_tags": "</font>"
},"database_name":{
"pre_tags": "<font color=red>",
"post_tags": "</font>"
},"table_name":{
"pre_tags": "<font color=red>",
"post_tags": "</font>"
}
}
},
"sort": [
{"_score": {"order": "desc"}},
{"_doc": {"order": "desc"}}
],
"from":0,
"size": 2
}
OST index_alias_name/_rollover/
{
"conditions": {
"max_age": "7d", //设置:最大时间7天
"max_docs": 10000,//设置:最大文档记录数
"max_size": "5gb" //设置:索引最大容量
}
}
POST _bulk/?refresh=true
{ "index" : { "_index" : "12_assets_directory_v1","_type" : "_doc" }}
{ "file_name": "Lucene is cool","file_type": "file","database_name": "","table_name": "","include_fields": "","source_business": 1,"store_type": "hdfs","whether_online": 0,"foreign_id": 10,"update_time": 1618560193000}
{ "index" : { "_index" : "12_assets_directory_v1","_type" : "_doc" }}
{ "file_name": "hdfs用户文件","file_type": "file","database_name": "","table_name": "","include_fields": "","source_business": 1,"store_type": "hdfs","whether_online": 0,"foreign_id": 11,"update_time": 1618560193010}
{ "index" : { "_index" : "12_assets_directory_v1","_type" : "_doc" }}
{ "file_name": "","file_type": "table","database_name": "geespace_bd_platform_dev","table_name": "12_mysql-1","include_fields": "","source_business": 1,"store_type": "mysql","whether_online": 0,"foreign_id": 10,"update_time": 1618560193020}
{ "index" : { "_index" : "12_assets_directory_v1","_type" : "_doc" }}
{ "file_name": "","file_type": "table","database_name": "geespace_bd_platform_dev","table_name": "103_addserialnumber_2","include_fields": "","source_business": 1,"store_type": "mysql","whether_online": 0,"foreign_id": 11,"update_time": 1618560193030}
==注意:每个json串不能换行,只能放到一行==
详情查看->https://blog.csdn.net/chen18677338530/article/details/93067493
1.ElasticSearch7.6.x 模板及滚动索引创建及注意事项
https://blog.csdn.net/a924382407/article/details/115082265
2.ElasticSearch的IK分词器
https://blog.csdn.net/a924382407/article/details/117255506
3.ElasticSearch核心概念:倒排索引
https://blog.csdn.net/a924382407/article/details/117255449
4.springboot集成ElasticSearch使用completion实现补全功能
https://blog.csdn.net/a924382407/article/details/115868167
5.ES Restful API讲解使用
https://blog.csdn.net/a924382407/article/details/115085022
6.ES API,使用Kibana的开发工具用例说明
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。