【Elasticsearch】Golang擴大查詢窗口,默認查詢窗口爲10

es的查詢每次默認返回10條數據

擴大數據 在index裏添加 "max_result_window" : 10000 屬性,每次返回大小爲10000條


const testMapping = `
{
	"settings":{
		"number_of_shards": 1,
		"number_of_replicas": 0,
		"max_result_window" : 10000
	},
	"mappings":{
			"properties":{
				"user":{
					"type":"keyword"
				},
				"message":{
					"type":"text"
				}
			}
	}
}`

或者直接用kibana在該索引上執行

 

curl -XPUT http://localhost:9200/test_index/_settings -d '{ "index" : { "max_result_window" : 10000}}'

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章