常用查询命令
查询版本号 (7.6.2)
request
GET http://192.168.100.38:9200
查询健康情况
request
GET http://192.168.100.38:9200/_cluster/health?pretty
查询所有节点数
request
GET http://192.168.100.38:9200/_cat/nodes?pretty
查询所有节点信息
request
GET http://192.168.100.38:9200/_cat/allocation?pretty
查询所有索引
curl -XGET http://192.168.100.38:9200/_cat/indices?pretty
request
GET http://192.168.100.38:9200/_cat/indices?v&pretty
删除索引[可通配符]
curl -XDELETE http://192.168.100.38:9200/kms_knowledge*
查询数据结构
request
GET kms_knowledge_check/_mapping?pretty
查询索引的所有数据
request
GET kms_knowledge_check/_search?pretty
attachment
request
GET _ingest/pipeline
request
DELETE _ingest/pipeline/simple_attachment
request
PUT _ingest/pipeline/my_attachment
{
"description": "Extract attachment for knowledge",
"processors": [
{
"attachment": {
"field": "knowContent"
}
}
]
}
request
PUT kms_knowledge/_doc/my_id?pipeline=my_attachment
{
"knowContent": "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0="
}
request
GET kms_knowledge/_doc/my_id
request
GET kms_knowledge_test/_search
{
"query": {
"match": {
"attachment.content": "测试"
}
}
}
request
POST kms_knowledge/_update/string
{
"script": {
"source": "TemporalAccessor tem = DateTimeFormatter.ofPattern('yyyy-MM-dd HH:mm:ss', Locale.CHINA).parse(ctx._source['sysCreateTime']); ctx._source['countHot'] = 1 + tem.getLong(ChronoField.EPOCH_DAY);"
}
}