一:建立索引

请求方式:put

 

请求url:

127.0.0.1:9200/rain_run_index

 

请求体:

{
    "mappings":{
        "properties":{
            "deviceNo":{
                "type":"text",
                "fields":{
                    "keyword":{
                        "type":"keyword",
                        "ignore_above":256
                    }
                }
            },
            "customerId":{
                "type":"long"
            },
            "rainValue":{
                "type":"double"
            },
            "createTime":{
                "type":"date",
                "format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
            }
        }
    },
    "settings":{
        "number_of_shards":"3",
        "number_of_replicas":"1",
        "translog":{
            "durability":"async"
        }
    }
}

 

二:window大小调整

1.说明

  按照正常情况,from,size的大小是10000,如果刚好12000条数据,可以修改下window的大小

 

2.设置setting

  请求url:

put http://127.0.0.1:9200/rain_area_index/_settings

  请求体:

{
    "index.max_result_window":"100000"
}

 

 posted on 2022-12-05 15:02  曹军  阅读(317)  评论(0编辑  收藏  举报