启动服务
#查看所有记录状态
GET _search
{
"query": {
"match_all": {}
}
}
#查看集群健康状态
GET _cat/health
#查看节点状态
GET _cat/nodes
#查看索引状态
GET _cat/indices
#查看总记录数
get _cat/count
#查看分片情况
get _cat/shards
#查看安装的插件
get _cat/plugins
删除索引
DELETE /joke_test
PUT /joke_test
POST _reindex
{
"source": {
"index": "joke_test"
},
"dest": {
"index": "joke_testa"
}}
PUT /joke_test
GET joke_test/_mapping?pretty
get joke_test/_search
get _cat/plugins
put joke/_alias/joke_test
get joke3
get _template
delete _template/
get _template/ptt_joke
POST _template/ptt_joke
{
"order": 0,
"template": "joke_test*",
"settings": {
"index": {
"refresh_interval": "5s",
"analysis": {
"analyzer": {
"optimizeIK": {
"filter": [
"stemmer"
],
"type": "custom",
"tokenizer": "ik_max_word"
}
}
},
"number_of_shards": "3",
"number_of_replicas": "1"
}
}
}
get _search/template
delete joke3/_mapping/
delete joke_test
get joke_test
PUT joke_test
{
"mappings": {
"news_article": {
"properties": {
"ability": {
"properties": {
"ability_code": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"id": {
"type": "long"
},
"img_id": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"parent_id": {
"type": "long"
}
}
},
"author_id": {
"type": "long"
},
"content": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"gmt_create": {
"type": "date"
},
"gmt_update": {
"type": "date"
},
"is_delete": {
"type": "long"
},
"is_online": {
"type": "long"
},
"is_original": {
"type": "long"
},
"label_array": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"analyzer": "ik_smart"
},
"level_code": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"news_type": {
"type": "long"
},
"online_date": {
"type": "date"
},
"resource_ids": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"source": {
"type": "long"
},
"status": {
"type": "long"
},
"transmit_type": {
"type": "long"
},
"type": {
"type": "long"
},
"user": {
"properties": {
"age": {
"type": "long"
},
"gender": {
"type": "long"
},
"id": {
"type": "long"
},
"loc": {
"properties": {
"coordinates":{
"type": "geo_point"
}
}
},
"popularity": {
"type": "long"
}
}
}
}
},
"resource": {
"dynamic": "false",
"properties": {
"label_array": {
"type": "text",
"analyzer": "ik_smart"
},
"online_time": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss"
},
"source_crawl_time": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"source_publish_time": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"title": {
"type": "text",
"analyzer": "ik_smart"
}
}
}
}
}