Elasticsearch——》kibana操作索引:增删改查
请参考:总结——》【Elasticsearch】
·
一、新建索引
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、指定分词器
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、新增索引字段
PUT /test_001/_mapping
{
"properties": {
"actArea": {
"type": "double"
}
}
}
三、查看索引
1、查看所有索引(状态)
GET _cat/indices
2、查看所有索引(详细)
GET _all
3、查看指定索引
GET test_001
四、删除索引
DELETE test_001
更多推荐
已为社区贡献6条内容
所有评论(0)