使用本方法,显式的执行refresh
操作。
默认情况下,ElasticSearch
启动后台任务,周期性执行refresh
操作,周期使用参数index.refresh_interval
控制。
本方法触发的refresh
为同步操作,运行完毕之后才会返回任务的执行结果。
指定索引,执行refresh
操作。
命令样例如下:
curl -X POST "https://localhost:9200/testindex_001/_refresh?pretty" --cacert $ES_HOME/config/certs/http_ca.crt -u "elastic:ohCxPH=QBE+s5=*lo7F9"
或者
curl -X GET "https://localhost:9200/testindex_001/_refresh?pretty" --cacert $ES_HOME/config/certs/http_ca.crt -u "elastic:ohCxPH=QBE+s5=*lo7F9"
执行结果的样例,如下:
{"_shards" : {"total" : 2,"successful" : 1,"failed" : 0}
}
不指定索引,执行refresh
操作。
curl -X POST "https://localhost:9200/_refresh?pretty" --cacert $ES_HOME/config/certs/http_ca.crt -u "elastic:ohCxPH=QBE+s5=*lo7F9"
或者
curl -X GET "https://localhost:9200/_refresh?pretty" --cacert $ES_HOME/config/certs/http_ca.crt -u "elastic:ohCxPH=QBE+s5=*lo7F9"
执行结果的样例,如下:
{"_shards" : {"total" : 13,"successful" : 5,"failed" : 0}
}
相关资料
- Refresh API
- Index modules