elasticsearch查詢報no [query] registered for [filtered]

這是因爲從es的5.0版本開始,原先的filtered語句,形如

{
	"query": {
		"filtered": {
			"bool": {
				"filter": {
					"range": {
						"age": {
							"gt": 26
						}
					}
				},
				"must": {
					"match": {
						"last_name": "smith"
					}
				}
			}
		}
	}
}

被淘汰,對應的替換語法是

{
	"query": {
		"bool": {
			"filter": {
				"range": {
					"age": {
						"gt": 26
					}
				}
			},
			"must": {
				"match": {
					"last_name": "smith"
				}
			}
		}
	}
}

 

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