# Parsing Exception when using Bucket\_sort with org.elasticsearch.test.framework:8.6.2

**URL:** <https://discuss.elastic.co/t/parsing-exception-when-using-bucket-sort-with-org-elasticsearch-test-framework-8-6-2/325893>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [February 18, 2023, 5:00pm UTC](https://discuss.elastic.co/t/parsing-exception-when-using-bucket-sort-with-org-elasticsearch-test-framework-8-6-2/325893 "2023-02-18T17:00:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neoministein](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/neoministein/32/117425_2.png) [@Neoministein](https://discuss.elastic.co/u/Neoministein)\
**Post date:** [February 18, 2023, 5:00pm UTC](https://discuss.elastic.co/t/parsing-exception-when-using-bucket-sort-with-org-elasticsearch-test-framework-8-6-2/325893/1 "2023-02-18T17:00:39Z")

</div>

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.

```auto
{
	"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.

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

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 18, 2023, 5:01pm UTC](https://discuss.elastic.co/t/parsing-exception-when-using-bucket-sort-with-org-elasticsearch-test-framework-8-6-2/325893/2 "2023-03-18T17:01:16Z")

</div>

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