Parsing Exception when using Bucket_sort with org.elasticsearch.test.framework:8.6.2

I am using org.elasticsearch.test.framework for Integration testing parts of my codebase.

I am currently using the Elasticsearch Java API Client 8.7.0-SNAPSHOT to use the new BulkIngester.

I've therefore bumped the version of elastic test framework from 7.17.6 to the newest available version 8.6.2 and now when I run a term aggregation with bucket sort I get the following error.

{
	"error": {
		"col": 156,
		"line": 1,
		"type": "parsing_exception",
		"reason": "Unknown aggregation type [bucket_sort] did you mean [bucket_script]?",
		"caused_by": {
			"type": "named_object_not_found_exception",
			"reason": "[1:156] unknown field [bucket_sort]"
		},
		"root_cause": [
			{
				"col": 156,
				"line": 1,
				"type": "parsing_exception",
				"reason": "Unknown aggregation type [bucket_sort] did you mean [bucket_script]?"
			}
		]
	},
	"status": 400
}

Here is the query I get from the Java API Client. When I run the query on a normal instance of Elasticsearch everything works fine.

{
	"aggregations": {
		"termAggregation": {
			"aggregations": {
				"0": {
					"avg": {
						"field": "weight"
					}
				},
				"sortByBucketSort": {
					"bucket_sort": {
						"sort": [
							{
								"0": {
									"order": "desc"
								}
							}
						]
					}
				}
			},
			"terms": {
				"field": "name.keyword",
				"size": 10
			}
		}
	},
	"size": 0
}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.