首页 > 其他分享 >ES 常用API:创建索引,创建别名,重建索引

ES 常用API:创建索引,创建别名,重建索引

时间:2024-09-19 11:16:22浏览次数:1  
标签:http keyword sensitive -- 创建 analyzer 索引 API type

华为云不同版本间索引同步数据(目前华为后台工具不能跨版本间同步数据):
ES 常用API:创建索引,创建别名,重建索引

华为云不同版本间索引同步数据(目前华为后台工具不能跨版本间同步数据):
elasticdump --input http://admin:123456@ip:9200/sensitive_1_v15 --output http://admin:123123@ip2:9200/sensitive_1_v14 --type=settings
elasticdump --input http://admin:123456@ip:9200/sensitive_1_v15 --output http://admin:123123@ip2:9200/sensitive_1_v14 --type=mapping
elasticdump --input http://admin:123456@ip:9200/sensitive_1_v15 --output http://admin:123123@ip2:9200/sensitive_1_v14 --limit=10000 --type=data

常用api:

查询当前的查询任务:http://ip:9200/_cat/tasks?v&detailed=true
查询当前的索引结构:http://ip:9210/sensitive_1_v13
查询实例所有所有:http://ip:9210/_cat/indices?v

创建索引:http://ip:9202/sensitive_1_v12
{
"sensitive_1_v12": {
"aliases": {
},
"mappings": {
"properties": {
"AddTime": {
"type": "date"
},
"Brand": {
"type": "keyword",
"normalizer": "lowercase_analyzer"
},
"BrandLen": {
"type": "integer"
},
"BrandUpper": {
"type": "keyword"
},
"CategoryIds": {
"type": "text",
"analyzer": "digit_analyzer"
},
"Country": {
"type": "text",
"analyzer": "digit_analyzer"
},
"GoogleWordLabel": {
"type": "keyword"
},
"Id": {
"type": "keyword"
},
"ImportTime": {
"type": "date"
},
"IsIncludeCategory": {
"type": "keyword"
},
"IsSetRiskDetect": {
"type": "boolean"
},
"IsSimilar": {
"type": "boolean"
},
"LabelStatus": {
"type": "keyword"
},
"NiceCl": {
"type": "text",
"analyzer": "digit_analyzer"
},
"PlatformIds": {
"type": "text",
"analyzer": "digit_analyzer"
},
"Remark": {
"type": "text",
"index": false
},
"RiskLevel": {
"type": "keyword"
},
"SearchBrand": {
"type": "text",
"analyzer": "standard"
},
"SiteCodes": {
"type": "text",
"analyzer": "digit_analyzer"
},
"UpdateAdminId": {
"type": "keyword"
},
"UpdateAdminName": {
"type": "keyword"
},
"UpdateTime": {
"type": "date"
},
"ZhcxWordLabel": {
"type": "keyword"
}
}
},
"settings": {
"index": {
"search": {
"slowlog": {
"threshold": {
"fetch": {
"debug": "3s"
},
"query": {
"warn": "1s"
}
}
}
},
"indexing": {
"slowlog": {
"threshold": {
"index": {
"info": "5s"
}
}
}
},
"number_of_shards": "6",
"analysis": {
"normalizer": {
"lowercase_analyzer": {
"filter": [
"lowercase"
],
"type": "custom",
"char_filter": []
}
},
"analyzer": {
"digit_analyzer": {
"filter": [
"lowercase"
],
"type": "custom",
"tokenizer": "comma_tokenizer"
}
},
"tokenizer": {
"comma_tokenizer": {
"type": "char_group",
"tokenize_on_chars": [
"whitespace",
","
]
}
}
},
"number_of_replicas": "1"
}
}
}
}

重建索引:http://ip:9202/_reindex
{
"source": {
"index": "sensitive_1_v11"
},
"dest": {
"index": "sensitive_1_v12"
},
"script": {
"source": "ctx._source.remove("@timestamp");ctx._source.remove("@version");"
}
}

添加别名:http://ip:9202/_aliases
{
"actions": [
{
"remove":{
"index": "sensitive_1_v14",
"alias": "sensitive_1"
}
},
{
"add": {
"index": "sensitive_1_v15",
"alias": "sensitive_1"
}
}
]
}

新ES库设置参数:http://ip:9200/_cluster/settings
{
"persistent" : {
"search": {
"max_open_scroll_context": "2147483647"
}
},
"transient": {
"search": {
"max_open_scroll_context": "2147483647"
}
}
}

标签:http,keyword,sensitive,--,创建,analyzer,索引,API,type
From: https://www.cnblogs.com/chenshaojun2008/p/18420212

相关文章

  • 如何使用自动化测试工具来提高API测试的效率?
    在软件开发生命周期中,API测试是确保应用程序质量和性能的关键环节。随着API的复杂性增加,手动测试已无法满足快速迭代和高质量交付的需求。自动化测试工具的出现,为API测试带来了革命性的改变。本文将探讨如何利用自动化测试工具提高API测试的效率。自动化测试工具的优势提高测试速度......
  • 修复控制台出现Deprecation Warning: The legacy JS API is deprecated and will be r
    背景项目使用到Vite+Sass,然后突然某天启动项目,控制台出现了这一行报错,找了一遍没找到解决方案。最后去StackOverflow找了一下,解决了。修复方式在vite.config.js中添加这一配置即可。import{defineConfig}from"vite";exportdefaultdefineConfig({//...css:......
  • DevExpress中文教程:如何将WinForms数据网格连接到ASP. NET Core WebAPI服务?
    日前DevExpress官方发布了DevExpressWinForms的后续版本——将.NET桌面客户端连接到安全后端WebAPI服务(EFCorewithOData),在本文中我们将进一步演示如何使用一个更简单的服务来设置DevExpressWinForms数据网格。P.S:DevExpressWinForms拥有180+组件和UI库,能为WindowsForms......
  • 如何测试和验证API的性能和稳定性?
    在开发过程中,测试和验证API的性能和稳定性是确保软件质量的关键步骤。以下是一些有效的方法和最佳实践:功能测试:首先,确保API的所有功能按预期工作。这包括对请求参数、方法、路径和预期响应的理解,以及对正常流程和异常流程的测试。性能测试:使用工具如JMeter、Apifox或Postman进......
  • 【信创】Linux上如何创建和管理自定义的 systemd 服务 _ 统信 _ 麒麟 _ 方德
    原文链接:【信创】Linux上如何创建和管理自定义的systemd服务|统信|麒麟|方德Hello,大家好啊!今天给大家带来一篇关于在Linux系统上如何创建和管理自己的systemd服务的文章。systemd是Linux系统中的初始化系统和服务管理器,它为系统提供了强大的服务管理功能。通过创建和......
  • MySQL 触发器的创建、使用及在 Java 中的调用
    在数据库管理中,MySQL的触发器是一种强大的工具,它可以在特定的数据库事件发生时自动执行一系列操作。同时,我们还可以在Java应用程序中与这些触发器进行交互,实现更复杂的业务逻辑。今天,我们就来一起探讨如何在MySQL中创建和使用触发器,并在Java中调用它们。一、MySQL中创建和......
  • Python中的元类:掌握类的创建与定制
    在面向对象编程中,类是组织代码的重要手段。但在Python中,类本身也是对象,这意味着它们可以被创建、修改甚至定制。元类(Metaclass)是Python中的一种高级特性,它允许你在类被创建时对其进行修改或增强。本文将带你深入了解元类的概念、作用以及如何在实践中使用元类。元类是什么......
  • 模拟创建分类.java
    Category.javapublicclassCategory{privateLongid;privateStringname;privateintpostCount;publicCategory(){}publicCategory(Stringname){this.name=name;}publicCategory(Stringname,intpostC......
  • 2024年9个优秀企业服务API
    运用企业服务API收集精准且具洞察力的数据,以优化业务策略、加深对消费者的理解、提供个性化的产品,从而加速业务增长。丰富的数据可强化销售体系,提升外展销售能力。通过数据辅助决策及收集潜在客户信息,实现拓展活动的针对性,提高成交几率和开启新对话的概率。如此,品牌得以......
  • 机器翻译之创建Seq2Seq的编码器、解码器
    1.创建编码器、解码器的基类1.1创建编码器的基类fromtorchimportnn#构建编码器的基类classEncoder(nn.Module):#继承父类nn.Moduledef__init__(self,**kwargs):#**kwargs:不定常的关键字参数super().__init__(**kwargs)defforwa......