PUT /索引名/_mapping
{
"properties": {
"businessid": {
"type": "keyword"
}
}
}
GET /索引名/_search
{
"query": {
"bool": {
"must": [
{
"exists": {
"field": "auto_insurance_policy"
}
}
]
}
},"_source": ["name","credential_no","auto_insurance_policy"]
, "size": 100
}
POST /索引名/_delete_by_query
{
"query": {
"match": {
"type": "4"
}
}
}
DELETE /索引名
GET /索引名/_search
{
"query": {
"bool": {
"must": [
{
"match": {
"type": "2"
}
},
{
"match": {
"lio": "edfcvwsd"
}
}
]
}
}
}
gte是大于等于 gt是大于 lte是小于等于 lt是小于
GET /索引名/_search
{
"query": {
"range": {
"pt_dt": {
"gte": "2023-07-20"
}
}
}
}
GET 索引名/_search
{
"query": {
"bool": {
"filter": {
"regexp": {
"time": {
"value": ".{20,}"
}
}
}
}
}
}
POST /_aliases
{
"actions" : [
{ "add" : { "index" : "gfds", "alias" : "lzdsy" } },
{ "add" : { "index" : "jhgfd", "alias" : "lzdsy" } },
{ "add" : { "index" : "ytrew", "alias" : "lzdsy" } },
{ "add" : { "index" : "nbvc", "alias" : "lzdsy" } }
]
}
POST /_aliases
{
"actions" : [
{ "add" : { "index" : "qazxftrds", "alias" : "lzdsy" } }
]
}
GET lzdsy/_alias
curl -XGET -H "Content-Type: application/json" '29.16.132.20:80/1013_dwa_policy_summary_auto/_count'
POST 索引名/_doc/1f573878273511dc13509f03c422095d
{
"key" : "1f573878273511dc13509f03c422095d",
"num" : "粤567891a",
"pt_date" : "2023-05-29"
}
GET /索引名/_search
{
"_source": [
"timeEnd",
"coverageCode"
],
"from": 0,
"query": {
"bool": {
"filter": [
{
"range": {
"quotationDate": {
"gte": "2021-01-01",
"lte": "2021-02-02"
}
}
}
],
"must": [
{
"term": {
"telSalesmanCode": "22002202"
}
},
{
"term": {
"deptGroupCode": "22002202"
}
},
{
"term": {
"officeCode": "22002202"
}
},
{
"bool": {
"should": [
{
"term": {
"qaz": "876543234567"
}
},
{
"term": {
"edc": "22002202"
}
}
]
}
},
"size": 20
}
curl http://192.168.28.11:80/_cat/health?v
查看分片
curl http://192.168.28.11:80/_cat/shards
curl -XPOST -H "Content-Type: application/json" '192.168.28.11:80/_cluster/reroute' -d '{
"commands": [
{
"allocate_empty_primary": {
"index": ".kibana_task_manager_1",
"shard": 0,
"node": "node-222",
"accept_data_loss": true
}
}
]
}
'
GET 索引名/_mapping
GET 索引名/_search
{
"query": {
"match": {
"key": "00525cf74a78a9262c6f9ced1a5bb559"
}
}
}