获取索引配置
GET secisland3/_settings

更新索引配置
PUT secisland3/_settings
{
"index": {
"number_of_replicas":0
}
}
更新分词器
创建索引之后可以添加新的分词器,添加分析器之前必须先关闭索引,添加之后再打开索引。
POST secisland3/_close
PUT secisland3/_settings
{
"analysis": {
"analyzer": {
"content":{
"type":"custom",
"tokenizer":"whitespace"
}
}
}
}
POST secisland3/_open
索引分析

![]()
POST _analyze
{
"analyzer": "standard",
"text": "this is a test"
}

自定义分词器:
POST _analyze
{
"tokenizer": "keyword",
"char_filter": ["html_strip"],
"text": "this is a <b>test<b>"
}



本文介绍了如何在ElasticSearch7中进行索引管理,包括获取索引配置、更新索引副本数量、添加自定义分词器以及进行索引分析。通过具体的API调用展示了关闭和打开索引、设置分析器的过程,以及自定义分词器的分析示例。
2万+

被折叠的 条评论
为什么被折叠?



